Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
draganescu committed Jan 30, 2024
1 parent 3699f14 commit 3bf89b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions phpunit/blocks/class-wp-navigation-block-renderer-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function test_gutenberg_default_block_is_enclosed_in_li_tags() {
$navigation_link_block = new WP_Block( $parsed_block, $context );

// Setup an empty testing instance of `WP_Navigation_Block_Renderer` and save the original.
$reflection = new ReflectionClass( 'WP_Navigation_Block_Renderer_Gutenberg' );
$reflection = new ReflectionClass( 'WP_Navigation_Block_Renderer' );
$method = $reflection->getMethod( 'get_markup_for_inner_block' );
$method->setAccessible( true );
// Invoke the private method.
Expand Down Expand Up @@ -53,7 +53,7 @@ public function test_gutenberg_get_markup_for_inner_block_site_title() {
$site_title_block = new WP_Block( $parsed_block, $context );

// Setup an empty testing instance of `WP_Navigation_Block_Renderer` and save the original.
$reflection = new ReflectionClass( 'WP_Navigation_Block_Renderer_Gutenberg' );
$reflection = new ReflectionClass( 'WP_Navigation_Block_Renderer' );
$method = $reflection->getMethod( 'get_markup_for_inner_block' );
$method->setAccessible( true );
// Invoke the private method.
Expand All @@ -71,7 +71,7 @@ public function test_gutenberg_get_markup_for_inner_block_site_title() {
* @covers WP_Navigation_Block_Renderer::get_inner_blocks_from_navigation_post
*/
public function test_gutenberg_get_inner_blocks_from_navigation_post_returns_empty_block_list() {
$reflection = new ReflectionClass( 'WP_Navigation_Block_Renderer_Gutenberg' );
$reflection = new ReflectionClass( 'WP_Navigation_Block_Renderer' );
$method = $reflection->getMethod( 'get_inner_blocks_from_navigation_post' );
$method->setAccessible( true );
$attributes = array( 'ref' => 0 );
Expand Down
2 changes: 2 additions & 0 deletions phpunit/class-block-library-navigation-link-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,14 @@ public function test_returns_link_for_decoded_link() {
'https://example.com/?id=10&data=lzB%252Fzd%252FZA%253D%253D',
'https://example.com/?id=10&data=lzB%2Fzd%FZA%3D%3D',
'https://example.com/?id=10&data=1234',
'https://example.com/?arrayParams[]=1&arrayParams[]=2&arrayParams[]=3',
);

$urls_after_render = array(
'https://example.com/?id=10&data=lzB%2Fzd%2FZA%3D%3D',
'https://example.com/?id=10&data=lzB%2Fzd%FZA%3D%3D',
'https://example.com/?id=10&data=1234',
'https://example.com/?arrayParams%5B%5D=1&arrayParams%5B%5D=2&arrayParams%5B%5D=3',
);

foreach ( $urls_before_render as $idx => $link ) {
Expand Down

0 comments on commit 3bf89b3

Please sign in to comment.