变更集55951
图例:
未修改 补充 远离的
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php 53760兰特 人民币55951元 327 327 } 328 328 329 if(rest_is_field_included('is_block_theme',$fields)){ 330 $data['is_block_theme']=$theme->is_block _theme(); 331 } 332 329 333 $data=$this->add_additional_fields_to_object($data,$request); 330 334 … … 495 499 ), 496 500 ), 501 “is_block_theme”=>数组( 502 “description”=>__(“主题是否是基于块的主题。”), 503 “type”=>“boolean”, 504 “只读”=>true, 505 ), 497 506 “name”=>数组( 498 507 'description'=>__('主题的名称。'), -
trunk/tests/phpunit/tests/rest-api/rest-themes-controller.php 55822兰特 55951兰特 173 173 “author_uri”, 174 174 '说明', 175 '是块主题', 175 176 “名称”, 176 177 '需要_php', … … 186 187 “版本”, 187 188 ); 189 $this->assertIsArray($data); 190 $this->assertNotEmpty($data); 188 191 $this->assertSameSet($fields,array_keys($data[0])); 189 192 } … … 209 212 “author_uri”, 210 213 '说明', 214 '是块主题', 211 215 '名称', 212 216 '需要_php', … … 221 225 “版本”, 222 226 ); 227 $this->assertIsArray($data); 228 $this->assertNotEmpty($data); 223 229 $this->assertSameSet($fields,array_keys($data[0])); 224 230 … … 344 350 $data=$response->get_data(); 345 351 $properties=$data['schema']['properties']; 346 $this->assertCount(1 5 ,$properties); 352 $this->assertCount(1 6 ,$properties); 347 353 348 354 $this->assertArrayHasKey(“作者”,$properties); … … 357 363 $this->assertArrayHasKey(“原始”,$properties['description']['properties']); 358 364 $this->assertArrayHasKey('rendered',$properties['description']['properties']); 365 366 $this->assertArrayHasKey('is_block_theme',$properties); 359 367 360 368 $this->assertArrayHasKey(“名称”,$properties); … … 473 481 474 482 /** 483 *@票58123 484 *@covers WP_REST_Themes_Controller::prepare_item_for_response 485 */ 486 公共函数test_theme_is_block_theme(){ 487 //测试经典主题,在测试设置中激活。 488 $response=自身::perform_active_theme_request(); 489 $result=$response->get_data(); 490 491 $this->assertArrayHasKey('is_block_theme',$result[0]); 492 $this->assertFalse($result[0]['is_block_theme']); 493 494 //测试块主题。 495 switch_theme(“区块主题”); 496 $response=自身::perform_active_theme_request(); 497 $result=$response->get_data(); 498 499 $this->assertArrayHasKey('is_block_theme',$result[0]); 500 $this->assertTrue($result[0]['is_block_theme']); 501 } 502 503 /** 475 504 *@票49906 476 505 */ … … 1235 1264 “author_uri”, 1236 1265 '说明', 1266 'is_block_theme', 1237 1267 “名称”, 1238 1268 '需要_php',