Changeset 52381 for trunk/tests/phpunit/tests/rest-api/rest-server.php
- Timestamp:
- 12/15/2021 06:06:15 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-server.php
r52235 r52381 1026 1026 $this->assertArrayNotHasKey( 'wp:active-theme', $index->get_links() ); 1027 1027 1028 // Check site icon. 1028 // Check site logo and icon. 1029 $this->assertArrayHasKey( 'site_logo', $data ); 1029 1030 $this->assertArrayHasKey( 'site_icon', $data ); 1030 1031 } 1031 1032 1032 1033 /** 1034 * @ticket 50152 1035 */ 1036 public function test_index_includes_link_to_active_theme_if_authenticated() { 1037 $server = new WP_REST_Server(); 1038 wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) ); 1039 1040 $request = new WP_REST_Request( 'GET', '/' ); 1041 $index = $server->dispatch( $request ); 1042 1043 $this->assertArrayHasKey( 'https://api.w.org/active-theme', $index->get_links() ); 1044 } 1045 1046 /** 1033 1047 * @ticket 52321 1034 1048 */ 1035 public function test_ get_index_with_site_icon() {1049 public function test_index_includes_site_icon() { 1036 1050 $server = new WP_REST_Server(); 1037 1051 update_option( 'site_icon', self::$icon_id ); … … 1042 1056 1043 1057 $this->assertArrayHasKey( 'site_icon', $data ); 1044 $this->assert Equals( self::$icon_id, $data['site_icon'] );1058 $this->assertSame( self::$icon_id, $data['site_icon'] ); 1045 1059 } 1046 1060 … … 2081 2095 2082 2096 /** 2083 * @ticket 501522084 */2085 public function test_index_includes_link_to_active_theme_if_authenticated() {2086 wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );2087 2088 $index = rest_do_request( '/' );2089 $this->assertArrayHasKey( 'https://api.w.org/active-theme', $index->get_links() );2090 }2091 2092 /**2093 2097 * @ticket 53056 2094 2098 */
Note: See TracChangeset
for help on using the changeset viewer.