Skip to content

Commit

Permalink
Add conditional test
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanHerman committed Jun 24, 2024
1 parent 3268f70 commit e832aae
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions .dev/tests/phpunit/src/blocks/gist/test-index.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,27 @@ public function test_coblocks_block_gist_handler_returns_empty_string_without_pr
$this->assertSame( coblocks_block_gist_handler( array( 'http://godaddy.com' ) ), '' );
$this->assertSame( coblocks_block_gist_handler( array( 'https://gist.github.com' ) ), '' );

$this->assertEmpty(
coblocks_block_gist_handler(
array(
'https://gist.github.com/someuser/a04f4e14e3cd3b6d48157ea0706114f7',
'someuser/a04f4e14e3cd3b6d48157ea0706114f7',
global $wp_version;

if ( version_compare( $wp_version, '6.4', '<=' ) {
$this->assertNotEmpty(
coblocks_block_gist_handler(
array(
'https://gist.github.com/someuser/a04f4e14e3cd3b6d48157ea0706114f7',
'someuser/a04f4e14e3cd3b6d48157ea0706114f7',
)
)
)
);
);
} else {
$this->assertEmpty(
coblocks_block_gist_handler(
array(
'https://gist.github.com/someuser/a04f4e14e3cd3b6d48157ea0706114f7',
'someuser/a04f4e14e3cd3b6d48157ea0706114f7',
)
)
);
}
}

/**
Expand Down

0 comments on commit e832aae

Please sign in to comment.