Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/phpunit/tests/post/getPageByPath.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ public function test_get_page_by_path_priority() {
$this->assertSame( 'some-page', $page->post_name );

// get_page_by_path() should return a post of the requested type before returning an attachment.
// Keep assertEquals() because the objects are intentionally compared by value.
$this->assertEquals( $page, get_page_by_path( 'some-page' ) );

// Make sure get_page_by_path() will still select an attachment when a post of the requested type doesn't exist.
// Keep assertEquals() because the objects are intentionally compared by value.
$this->assertEquals( $other_att, get_page_by_path( 'some-other-page' ) );
}

Expand Down
2 changes: 2 additions & 0 deletions tests/phpunit/tests/post/meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,15 @@ public function test_get_post_meta_by_id() {
$mobj->post_id = self::$post_id;
$mobj->meta_key = 'get_post_meta_by_key';
$mobj->meta_value = 'get_post_meta_by_key_value';
// Keep assertEquals() because the objects are intentionally compared by value.
$this->assertEquals( $mobj, get_post_meta_by_id( $mid ) );
delete_metadata_by_mid( 'post', $mid );

$mid = add_post_meta( self::$post_id, 'get_post_meta_by_key', array( 'foo', 'bar' ), true );
$this->assertIsInt( $mid );
$mobj->meta_id = $mid;
$mobj->meta_value = array( 'foo', 'bar' );
// Keep assertEquals() because the objects are intentionally compared by value.
$this->assertEquals( $mobj, get_post_meta_by_id( $mid ) );
delete_metadata_by_mid( 'post', $mid );
}
Expand Down
1 change: 1 addition & 0 deletions tests/phpunit/tests/post/types.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ public function test_get_post_type_object_casting() {

$after = get_post_type_object( 'foo' )->labels;

// Keep assertEquals() because the objects are intentionally compared by value.
$this->assertEquals( $before, $after );

_unregister_post_type( 'foo' );
Expand Down
1 change: 1 addition & 0 deletions tests/phpunit/tests/post/wpCountAttachments.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public function test_wp_count_attachments_should_cache_the_result() {
$expected = wp_count_attachments( $mime_type );
$actual = wp_cache_get( $cache_key, 'counts' );

// Keep assertEquals() because the objects are intentionally compared by value.
$this->assertEquals( $expected, $actual );
}
}
Loading