Have you seen wordpress.org',
),
'In a text node, when it contains a protocol-relative absolute URL' => array(
'//wordpress.org',
+ 'https://wordpress.org/',
'Have you seen //wordpress.org? ',
),
'In a text node, when it contains a domain-only absolute URL' => array(
'wordpress.org',
+ 'https://wordpress.org/',
'Have you seen wordpress.org? ',
),
'In a text node, when it contains a domain-only absolute URL with path' => array(
'wordpress.org/plugins',
+ 'https://wordpress.org/plugins',
'Have you seen wordpress.org/plugins? ',
),
'Matches an empty string in as a valid relative URL when given a base URL' => array(
'',
+ 'https://wordpress.org/',
'',
- 'https://wordpress.org',
+ 'https://wordpress.org/',
),
'Skips over an empty string in when not given a base URL' => array(
'https://developer.w.org',
+ 'https://developer.w.org/',
'',
null,
),
'Skips over a class name in the tag' => array(
'https://developer.w.org',
+ 'https://developer.w.org/',
'',
null,
),
);
}
+ /**
+ *
+ * @dataProvider provider_test_finds_next_negative_url
+ */
+ public function test_next_url_finds_the_negative_url( $markup, $base_url = 'https://wordpress.org' ) {
+ $p = new BlockMarkupUrlProcessor( $markup, $base_url );
+ $this->assertFalse( $p->next_url(), 'Found a URL in the markup, but it wasn\'t the expected one.' );
+ }
+
+ public static function provider_test_finds_next_negative_url() {
+ return array(
+ 'In a block attribute, in a nested object, when it contains just the URL' => array(
+ '',
+ ),
+ 'In a block attribute, in an array, when it contains just the URL' => array(
+ '',
+ ),
+ );
+ }
+
/**
* @dataProvider provider_test_parse_url_with_base_url
*/
@@ -180,7 +204,7 @@ public static function provider_test_set_url_examples() {
public function test_set_url_complex_test_case() {
$p = new BlockMarkupUrlProcessor(
<<
+
@@ -204,9 +228,10 @@ public function test_set_url_complex_test_case() {
$p->set_url( 'https://site-export.internal', WPURL::parse( 'https://site-export.internal' ) );
}
+ // meta.src is a nested property and not supported yet
$this->assertEquals(
<<
+