diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 822b7f18d..183fa9557 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -59,13 +59,13 @@ jobs: include: # Test with the previous WP version. - php: '7.4' - wordpress: ${{ needs.compute-previous-wordpress-version.outputs.previous-wordpress-version }} + wordpress: 'previous major version' - php: '8.2' - wordpress: ${{ needs.compute-previous-wordpress-version.outputs.previous-wordpress-version }} + wordpress: 'previous major version' env: WP_ENV_PHP_VERSION: ${{ matrix.php }} - WP_ENV_CORE: ${{ matrix.wordpress == '' && 'WordPress/WordPress' || format( 'https://wordpress.org/wordpress-{0}.zip', matrix.wordpress ) }} + WP_ENV_CORE: ${{ matrix.wordpress == '' && 'WordPress/WordPress' || format( 'https://wordpress.org/wordpress-{0}.zip', needs.compute-previous-wordpress-version.outputs.previous-wordpress-version ) }} steps: - uses: actions/checkout@v3 diff --git a/classes/class-blocks.php b/classes/class-blocks.php index b3343e1e4..0a1538765 100644 --- a/classes/class-blocks.php +++ b/classes/class-blocks.php @@ -1500,11 +1500,11 @@ public function render_callback( $attributes, $content = null, $context = 'front 'class' => '', ); - if ( $attributes['blockUniqueClass'] ) { + if ( isset( $attributes['blockUniqueClass'] ) && $attributes['blockUniqueClass'] ) { $array_atts['class'] .= $attributes['blockUniqueClass']; } - if ( $attributes['align'] ) { + if ( isset( $attributes['align'] ) && $attributes['align'] ) { $array_atts['class'] .= ' align' . $attributes['align']; } diff --git a/package.json b/package.json index 05ff9bab9..60ee93c65 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "env:start": "wp-env start", "env:stop": "wp-env stop", "env:destroy": "wp-env destroy", - "test": "npm-run-all lint test:unit", + "test": "npm-run-all lint test:unit:php test:e2e", "test:e2e": "playwright test --config tests/e2e/playwright.config.js", "test:e2e:ui": "playwright test --config tests/e2e/playwright.config.js --ui", "test:e2e:install-playwright": "npx playwright install", diff --git a/tests/phpunit/block-render-test.php b/tests/phpunit/block-render-test.php index 71de61fa9..8609c1eda 100644 --- a/tests/phpunit/block-render-test.php +++ b/tests/phpunit/block-render-test.php @@ -6,6 +6,9 @@ public function add_test_block( $attrs = array() ) { lazyblocks()->add_block( array_merge( array( 'slug' => $block_slug, + 'supports' => array( + 'align' => false, + ), ), $attrs ) ); diff --git a/tests/phpunit/controls/select-control-test.php b/tests/phpunit/controls/select-control-test.php index 91b17c2cb..9e5a4ebe4 100644 --- a/tests/phpunit/controls/select-control-test.php +++ b/tests/phpunit/controls/select-control-test.php @@ -6,6 +6,9 @@ public function add_test_block( $attrs = array() ) { lazyblocks()->add_block( array_merge( array( 'slug' => $block_slug, + 'supports' => array( + 'align' => false, + ), ), $attrs ) );