Changeset 56226 for trunk/tests/phpunit/tests/block-supports/duotone.php
- Timestamp:
- 07/13/2023 11:32:19 AM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/block-supports/duotone.php
r56101 r56226 28 28 'attrs' => array( 'style' => array( 'color' => array( 'duotone' => 'var:preset|duotone|blue-orange' ) ) ), 29 29 ); 30 $wp_block = new WP_Block( $block ); 30 31 $block_content = '<figure class="wp-block-image size-full"><img src="/my-image.jpg" /></figure>'; 31 32 $expected = '<figure class="wp-block-image size-full wp-duotone-blue-orange"><img src="/my-image.jpg" /></figure>'; 32 $this->assertSame( $expected, WP_Duotone::render_duotone_support( $block_content, $block ) );33 $this->assertSame( $expected, WP_Duotone::render_duotone_support( $block_content, $block, $wp_block ) ); 33 34 } 34 35 … … 45 46 'attrs' => array( 'style' => array( 'color' => array( 'duotone' => 'unset' ) ) ), 46 47 ); 48 $wp_block = new WP_Block( $block ); 47 49 $block_content = '<figure class="wp-block-image size-full"><img src="/my-image.jpg" /></figure>'; 48 50 $expected = '/<figure class="wp-block-image size-full wp-duotone-unset-\d+"><img src="\\/my-image.jpg" \\/><\\/figure>/'; 49 $this->assertMatchesRegularExpression( $expected, WP_Duotone::render_duotone_support( $block_content, $block ) );51 $this->assertMatchesRegularExpression( $expected, WP_Duotone::render_duotone_support( $block_content, $block, $wp_block ) ); 50 52 } 51 53 … … 60 62 'attrs' => array( 'style' => array( 'color' => array( 'duotone' => array( '#FFFFFF', '#000000' ) ) ) ), 61 63 ); 64 $wp_block = new WP_Block( $block ); 62 65 $block_content = '<figure class="wp-block-image size-full"><img src="/my-image.jpg" /></figure>'; 63 66 $expected = '/<figure class="wp-block-image size-full wp-duotone-ffffff-000000-\d+"><img src="\\/my-image.jpg" \\/><\\/figure>/'; 64 $this->assertMatchesRegularExpression( $expected, WP_Duotone::render_duotone_support( $block_content, $block ) );67 $this->assertMatchesRegularExpression( $expected, WP_Duotone::render_duotone_support( $block_content, $block, $wp_block ) ); 65 68 } 66 69
Note: See TracChangeset
for help on using the changeset viewer.