- Timestamp:
- 09/02/2020 12:35:36 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-block-renderer-controller.php
r48858 r48937 336 336 ); 337 337 $response = rest_get_server()->dispatch( $request ); 338 $this->assert Equals( 400, $response->get_status() );338 $this->assertSame( 400, $response->get_status() ); 339 339 } 340 340 … … 357 357 ); 358 358 $response = rest_get_server()->dispatch( $request ); 359 $this->assert Equals( 400, $response->get_status() );359 $this->assertSame( 400, $response->get_status() ); 360 360 } 361 361 … … 382 382 $request->set_param( 'attributes', array() ); 383 383 $response = rest_get_server()->dispatch( $request ); 384 $this->assert Equals( 200, $response->get_status() );384 $this->assertSame( 200, $response->get_status() ); 385 385 $data = $response->get_data(); 386 386 387 $this->assert Equals( $defaults, json_decode( $data['rendered'], true ) );387 $this->assertSame( $defaults, json_decode( $data['rendered'], true ) ); 388 388 $this->assertEquals( 389 389 json_decode( $block_type->render( $defaults ) ), … … 417 417 $request->set_param( 'attributes', $attributes ); 418 418 $response = rest_get_server()->dispatch( $request ); 419 $this->assert Equals( 200, $response->get_status() );419 $this->assertSame( 200, $response->get_status() ); 420 420 $data = $response->get_data(); 421 421 422 $this->assert Equals( $expected_attributes, json_decode( $data['rendered'], true ) );422 $this->assertSame( $expected_attributes, json_decode( $data['rendered'], true ) ); 423 423 $this->assertEquals( 424 424 json_decode( $block_type->render( $attributes ), true ), … … 452 452 $request->set_param( 'attributes', $attributes ); 453 453 $response = rest_get_server()->dispatch( $request ); 454 $this->assert Equals( 200, $response->get_status() );454 $this->assertSame( 200, $response->get_status() ); 455 455 456 456 $data = $response->get_data(); 457 $this->assert Equals( '<p>Alternate content.</p>', $data['rendered'] );457 $this->assertSame( '<p>Alternate content.</p>', $data['rendered'] ); 458 458 459 459 remove_filter( 'pre_render_block', $pre_render_filter ); … … 475 475 $response = rest_get_server()->dispatch( $request ); 476 476 477 $this->assert Equals( 200, $response->get_status() );477 $this->assertSame( 200, $response->get_status() ); 478 478 $data = $response->get_data(); 479 479 … … 484 484 $response = rest_get_server()->dispatch( $request ); 485 485 486 $this->assert Equals( 200, $response->get_status() );486 $this->assertSame( 200, $response->get_status() ); 487 487 $data = $response->get_data(); 488 488 489 $this->assert Equals( $expected_title, $data['rendered'] );489 $this->assertSame( $expected_title, $data['rendered'] ); 490 490 } 491 491 … … 505 505 $response = rest_get_server()->dispatch( $request ); 506 506 507 $this->assert Equals( 200, $response->get_status() );507 $this->assertSame( 200, $response->get_status() ); 508 508 $this->assertContains( $string_attribute, $response->get_data()['rendered'] ); 509 509 } … … 579 579 $request->set_param( 'attributes', $attributes ); 580 580 $response = rest_get_server()->dispatch( $request ); 581 $this->assert Equals( 200, $response->get_status() );581 $this->assertSame( 200, $response->get_status() ); 582 582 $data = $response->get_data(); 583 583 … … 602 602 array_keys( $data['endpoints'][0]['args'] ) 603 603 ); 604 $this->assert Equals( 'object', $data['endpoints'][0]['args']['attributes']['type'] );604 $this->assertSame( 'object', $data['endpoints'][0]['args']['attributes']['type'] ); 605 605 606 606 $this->assertArrayHasKey( 'schema', $data ); 607 $this->assert Equals( 'rendered-block', $data['schema']['title'] );608 $this->assert Equals( 'object', $data['schema']['type'] );607 $this->assertSame( 'rendered-block', $data['schema']['title'] ); 608 $this->assertSame( 'object', $data['schema']['type'] ); 609 609 $this->arrayHasKey( 'rendered', $data['schema']['properties'] ); 610 610 $this->arrayHasKey( 'string', $data['schema']['properties']['rendered']['type'] ); 611 $this->assert Equals( array( 'edit' ), $data['schema']['properties']['rendered']['context'] );611 $this->assertSame( array( 'edit' ), $data['schema']['properties']['rendered']['context'] ); 612 612 } 613 613
Note: See TracChangeset
for help on using the changeset viewer.