Skip to content

Commit

Permalink
tepm : tests cssClassName with version logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Ta5r committed Sep 26, 2024
1 parent 8db320a commit 4004aec
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions tests/unit/CoreImageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,6 @@ public function test_retrieve_core_image_media_details(): void {

public function test_retrieve_core_image_attributes(): void {

// 'cssClassName' does not appends additional classes in and above WP 6.3.
// if ( ! is_wp_version_compatible( '6.3' ) ) {
// $this->markTestSkipped( 'This test requires WP 6.3 or higher.' );
// }

$block_content = '<!-- wp:image {"lightbox":{"enabled":false},"align":"left","width":500,"height":500,"aspectRatio":"4/3","scale":"cover","sizeSlug":"full","linkDestination":"none", "id":' . $this->attachment_id . ',"className":"is-style-rounded", "style":{"color":{"duotone":"var:preset|duotone|purple-green"}},"borderColor":"vivid-red","lock":{"move":true,"remove":true},"className":"test-css-class-name"} -->
<figure class="wp-block-image size-full is-resized" id="test-anchor">
<a class="test-link-css-class" href="http://decoupled.local/dcf-1-0/" target="_blank" rel="https://www.youtube.com/ noreferrer noopener">
Expand Down Expand Up @@ -272,7 +267,7 @@ className
'align' => 'left',
'caption' => 'Align left',
'className' => 'test-css-class-name',
'cssClassName' => 'wp-duotone-varpresetduotonepurple-green-19 wp-block-image size-full is-resized', // @todo : fix
'cssClassName' => ( ! is_wp_version_compatible( '6.3' ) ) ? 'wp-duotone-varpresetduotonepurple-green-19 wp-block-image size-full is-resized' : 'wp-block-image size-full is-resized', // This uses the old class name for WP < 6.3 which is wp-duotone-varpresetduotonepurple-green-19.
'url' => 'http://mysite.local/wp-content/uploads/2023/05/online-programming-course-hero-section-bg.svg',
'borderColor' => 'vivid-red',
'title' => 'test-title',
Expand Down

0 comments on commit 4004aec

Please sign in to comment.