diff --git a/tests/phpunit/tests/formatting/linksAddBaseUrl.php b/tests/phpunit/tests/formatting/linksAddBaseUrl.php index 0d88cc061a564..cbc8489a500e0 100644 --- a/tests/phpunit/tests/formatting/linksAddBaseUrl.php +++ b/tests/phpunit/tests/formatting/linksAddBaseUrl.php @@ -1,13 +1,13 @@ assertSame( $expected, links_add_base_url( $content, $base, $attrs ) ); - } else { + if ( is_null( $attrs ) ) { $this->assertSame( $expected, links_add_base_url( $content, $base ) ); + } else { + $this->assertSame( $expected, links_add_base_url( $content, $base, $attrs ) ); } } /** - * Data provider for test_links_add_base_url(). + * Data provider. * - * @return array[] + * @return array { + * @type array { + * @type string $content String to search for links in. + * @type string $base The base URL to prefix to links. + * @type array|null $attrs The attributes which should be processed. + * @type string $expected Expected output. + * } + * } */ public function data_links_add_base_url() { return array( @@ -41,19 +48,19 @@ public function data_links_add_base_url() { 'attrs' => null, 'expected' => '', ), - 'relative_scheme' => array( + 'relative scheme' => array( 'content' => '', 'base' => 'http://localhost', 'attrs' => null, 'expected' => '', ), - 'empty_array' => array( + 'empty array' => array( 'content' => '', 'base' => 'https://localhost', 'attrs' => array(), - 'expected' => '', + 'expected' => '', ), - 'data_url' => array( + 'data-url' => array( 'content' => '', 'base' => 'https://localhost', 'attrs' => array( 'data-url', 'href' ), @@ -65,7 +72,7 @@ public function data_links_add_base_url() { 'attrs' => null, 'expected' => '', ), - 'no_href' => array( + 'no href' => array( 'content' => '', 'base' => 'https://localhost', 'attrs' => null, diff --git a/tests/phpunit/tests/formatting/linksAddTarget.php b/tests/phpunit/tests/formatting/linksAddTarget.php index 1c9a6fedf3016..31bc4cdcb3b84 100644 --- a/tests/phpunit/tests/formatting/linksAddTarget.php +++ b/tests/phpunit/tests/formatting/linksAddTarget.php @@ -1,5 +1,7 @@