Changeset 47239 for trunk/tests/phpunit/tests/rest-api/rest-server.php
- Timestamp:
- 02/10/2020 04:06:58 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-server.php
r47224 r47239 1374 1374 } 1375 1375 1376 /** 1377 * @ticket 47077 1378 */ 1379 public function test_http_authorization_header_substitution() { 1380 $headers = array( 'HTTP_AUTHORIZATION' => 'foo' ); 1381 $parsed_headers = rest_get_server()->get_headers( $headers ); 1382 1383 $this->assertSame( 1384 array( 'AUTHORIZATION' => 'foo' ), 1385 $parsed_headers 1386 ); 1387 } 1388 1389 /** 1390 * @ticket 47077 1391 */ 1392 public function test_redirect_http_authorization_header_substitution() { 1393 $headers = array( 'REDIRECT_HTTP_AUTHORIZATION' => 'foo' ); 1394 $parsed_headers = rest_get_server()->get_headers( $headers ); 1395 1396 $this->assertSame( 1397 array( 'AUTHORIZATION' => 'foo' ), 1398 $parsed_headers 1399 ); 1400 } 1401 1402 /** 1403 * @ticket 47077 1404 */ 1405 public function test_redirect_http_authorization_with_http_authorization_header_substitution() { 1406 $headers = array( 1407 'HTTP_AUTHORIZATION' => 'foo', 1408 'REDIRECT_HTTP_AUTHORIZATION' => 'bar', 1409 ); 1410 $parsed_headers = rest_get_server()->get_headers( $headers ); 1411 1412 $this->assertSame( 1413 array( 'AUTHORIZATION' => 'foo' ), 1414 $parsed_headers 1415 ); 1416 } 1417 1418 /** 1419 * @ticket 47077 1420 */ 1421 public function test_redirect_http_authorization_with_empty_http_authorization_header_substitution() { 1422 $headers = array( 1423 'HTTP_AUTHORIZATION' => '', 1424 'REDIRECT_HTTP_AUTHORIZATION' => 'bar', 1425 ); 1426 $parsed_headers = rest_get_server()->get_headers( $headers ); 1427 1428 $this->assertSame( 1429 array( 'AUTHORIZATION' => 'bar' ), 1430 $parsed_headers 1431 ); 1432 } 1433 1376 1434 public function _validate_as_integer_123( $value, $request, $key ) { 1377 1435 if ( ! is_int( $value ) ) {
Note: See TracChangeset
for help on using the changeset viewer.