Changeset 57656
- Timestamp:
- 02/19/2024 03:05:46 PM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-navigation-fallback-controller.php
r56793 r57656 62 62 $data = $response->get_data(); 63 63 64 $this->assert Equals( 403, $response->get_status(), 'Response should indicate user does not have permission.' );65 66 $this->assert Equals( 'rest_cannot_create', $data['code'], 'Response should indicate user cannot create.' );67 68 $this->assert Equals( 'Sorry, you are not allowed to create Navigation Menus as this user.', $data['message'], 'Response should indicate failed request status.' );64 $this->assertSame( 403, $response->get_status(), 'Response should indicate user does not have permission.' ); 65 66 $this->assertSame( 'rest_cannot_create', $data['code'], 'Response should indicate user cannot create.' ); 67 68 $this->assertSame( 'Sorry, you are not allowed to create Navigation Menus as this user.', $data['message'], 'Response should indicate failed request status.' ); 69 69 } 70 70 … … 81 81 $data = $response->get_data(); 82 82 83 $this->assert Equals( 200, $response->get_status(), 'Status should indicate successful request.' );83 $this->assertSame( 200, $response->get_status(), 'Status should indicate successful request.' ); 84 84 85 85 $this->assertIsArray( $data, 'Response should be of correct type.' ); … … 87 87 $this->assertArrayHasKey( 'id', $data, 'Response should contain expected fields.' ); 88 88 89 $this->assert Equals( 'wp_navigation', get_post_type( $data['id'] ), '"id" field should represent a post of type "wp_navigation"' );89 $this->assertSame( 'wp_navigation', get_post_type( $data['id'] ), '"id" field should represent a post of type "wp_navigation"' ); 90 90 91 91 // Check that only a single Navigation fallback was created. … … 106 106 $data = $response->get_data(); 107 107 108 $this->assert Equals( 200, $response->get_status(), 'Status should indicate successful request.' );108 $this->assertSame( 200, $response->get_status(), 'Status should indicate successful request.' ); 109 109 110 110 $this->assertArrayHasKey( 'schema', $data, '"schema" key should exist in response.' ); … … 112 112 $schema = $data['schema']; 113 113 114 $this->assert Equals( 'object', $schema['type'], 'The schema type should match the expected type.' );114 $this->assertSame( 'object', $schema['type'], 'The schema type should match the expected type.' ); 115 115 116 116 $this->assertArrayHasKey( 'id', $schema['properties'], 'Schema should have an "id" property.' ); 117 $this->assert Equals( 'integer', $schema['properties']['id']['type'], 'Schema "id" property should be an integer.' );117 $this->assertSame( 'integer', $schema['properties']['id']['type'], 'Schema "id" property should be an integer.' ); 118 118 $this->assertTrue( $schema['properties']['id']['readonly'], 'Schema "id" property should be readonly.' ); 119 119 }
Note: See TracChangeset
for help on using the changeset viewer.