mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-31 10:44:26 +00:00
REST API: Set the comment type to a readonly property in the schema.
Document the type property as `readonly` and remove the default value. After #38820 it is no longer possible to set the type property on a comment to anything a custom type. Props jnylen0, rachelbaker. Fixes #38886. git-svn-id: https://develop.svn.wordpress.org/trunk@39337 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2330,10 +2330,12 @@ class WP_Test_REST_Comments_Controller extends WP_Test_REST_Controller_Testcase
|
||||
$this->assertArrayHasKey( 'post', $properties );
|
||||
$this->assertArrayHasKey( 'status', $properties );
|
||||
$this->assertArrayHasKey( 'type', $properties );
|
||||
$this->assertEquals( 'comment', $properties['type']['default'] );
|
||||
|
||||
$this->assertEquals( 0, $properties['parent']['default'] );
|
||||
$this->assertEquals( 0, $properties['post']['default'] );
|
||||
|
||||
$this->assertEquals( true, $properties['link']['readonly'] );
|
||||
$this->assertEquals( true, $properties['type']['readonly'] );
|
||||
}
|
||||
|
||||
public function test_get_item_schema_show_avatar() {
|
||||
|
||||
Reference in New Issue
Block a user