Changeset 38514
- Timestamp:
- 09/02/2016 10:52:48 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/oembed.php
r38512 r38514 93 93 } 94 94 95 $this->assertSame( 200, wp_remote_retrieve_response_code( $r ), $msg ); 95 $http_code = wp_remote_retrieve_response_code( $r ); 96 $http_message = wp_remote_retrieve_response_message( $r ); 97 $this->assertSame( 200, $http_code, "{$msg}\n- HTTP response code: {$http_code} {$http_message}" ); 96 98 97 99 } … … 135 137 'discover' => false, 136 138 ) ); 137 $this->assertNotFalse( $provider, $msg);139 $this->assertNotFalse( $provider, "{$msg}\n- No oEmbed provider found." ); 138 140 139 141 $data = self::$oembed->fetch( $provider, $url, $args ); … … 167 169 } 168 170 169 $this->assertSame( 200, wp_remote_retrieve_response_code( $r['response'] ), $msg ); 171 $http_code = wp_remote_retrieve_response_code( $r['response'] ); 172 $http_message = wp_remote_retrieve_response_message( $r['response'] ); 173 $this->assertSame( 200, $http_code, "{$msg}\n- HTTP response code: {$http_code} {$http_message}" ); 170 174 171 175 // Test response … … 343 347 'discover' => false, 344 348 ) ); 345 $this->assertNotFalse( $provider, $msg);349 $this->assertNotFalse( $provider, "{$msg}\n- No oEmbed provider found." ); 346 350 $data = self::$oembed->fetch( $provider, $url, $args ); 347 351 … … 370 374 } 371 375 372 $this->assertTrue( in_array( wp_remote_retrieve_response_code( $r['response'] ), array( 376 $http_code = wp_remote_retrieve_response_code( $r['response'] ); 377 $http_message = wp_remote_retrieve_response_message( $r['response'] ); 378 $this->assertContains( $http_code, array( 373 379 200, 374 380 400, 375 381 404, 376 ), true ), $msg);382 ), "{$msg}\n- HTTP response code: {$http_code} {$http_message}" ); 377 383 378 384 if ( false === $data ) { … … 580 586 $providers['twitter-timeline'], 581 587 array( 582 'https://twitter.com/ wordpress',588 'https://twitter.com/TwitterDev/timelines/539487832448843776', 583 589 ), 584 590 ),
Note: See TracChangeset
for help on using the changeset viewer.