Skip to content

Commit

Permalink
Update unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanHerman committed Jun 24, 2024
1 parent 45f8492 commit e3e6668
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .dev/tests/phpunit/src/blocks/gist/test-index.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ 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->assertNotEmpty(
$this->assertEmpty(
coblocks_block_gist_handler(
array(
'https://gist.github.com/someuser/a04f4e14e3cd3b6d48157ea0706114f7',
Expand All @@ -42,12 +42,12 @@ public function test_coblocks_block_gist_handler_returns_empty_string_without_pr
* Test that the embed handler returns the proper Gist embed code.
*/
public function test_coblocks_block_gist_handler_returns_valid_embed() {
$gist_url = 'https://gist.github.com/someuser/a04f4e14e3cd3b6d48157ea0706114f7';
$gist_path = 'someuser/a04f4e14e3cd3b6d48157ea0706114f7';
$gist_url = 'https://gist.github.com/EvanHerman/3e8058a093800e1b7c8b605a64525514';
$gist_path = 'EvanHerman/3e8058a093800e1b7c8b605a64525514';

$this->assertEquals(
coblocks_block_gist_handler( array( $gist_url, $gist_path ) ),
"<span class='coblocks-gist__container' style='pointer-events: none'><script src=\"https://gist.github.com/{$gist_path}.js\">\n\n</script>\n<a class=\"gist-block__container\" href=\"{$gist_url}\" target=\"_blank\">View this gist on GitHub</a></span>"
$this->assertMatchesRegularExpression(
"/<span class='coblocks-gist__container' style='pointer-events: none'><script src=\"https://gist.github.com/{$gist_path}.js\">/",
coblocks_block_gist_handler( array( $gist_url, $gist_path ) )
);
}

Expand Down

0 comments on commit e3e6668

Please sign in to comment.