mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Revert to pre-4.7 behavior for fetching object instances by id.
This changeset reverts [38381], which caused inconsistencies in the way the REST API fetches posts and other objects. See #38792, #37738. git-svn-id: https://develop.svn.wordpress.org/trunk@39992 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -49,15 +49,6 @@ class Tests_Term_WpComment extends WP_UnitTestCase {
|
||||
$this->assertFalse( $found );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 37738
|
||||
*/
|
||||
public function test_get_instance_should_fail_for_bool() {
|
||||
$found = WP_Comment::get_instance( true );
|
||||
|
||||
$this->assertFalse( $found );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 37738
|
||||
*/
|
||||
@@ -66,32 +57,4 @@ class Tests_Term_WpComment extends WP_UnitTestCase {
|
||||
|
||||
$this->assertEquals( 1, $found->comment_ID );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 37738
|
||||
*/
|
||||
public function test_get_instance_should_fail_for_float() {
|
||||
$found = WP_Comment::get_instance( 1.6 );
|
||||
|
||||
$this->assertFalse( $found );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 37738
|
||||
*/
|
||||
public function test_get_instance_should_fail_for_array() {
|
||||
$found = WP_Comment::get_instance( array( 1 ) );
|
||||
|
||||
$this->assertFalse( $found );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 37738
|
||||
*/
|
||||
public function test_get_instance_should_fail_for_class() {
|
||||
$class = new stdClass();
|
||||
$found = WP_Comment::get_instance( $class );
|
||||
|
||||
$this->assertFalse( $found );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user