mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-30 23:30:05 +00:00
Posts, Post types: Coding standards fixes following [54234].
Props costdev. See #36905. git-svn-id: https://develop.svn.wordpress.org/trunk@54242 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -166,7 +166,7 @@ class Tests_Post_GetPageByTitle extends WP_UnitTestCase {
|
||||
|
||||
$found = get_page_by_title( 'foo', OBJECT, 'wptests_pt' );
|
||||
$this->assertSame( $p2, $found->ID, 'Should find a post with post type wptests_pt.' );
|
||||
$num_queries ++;
|
||||
++$num_queries;
|
||||
$this->assertSame( $num_queries, get_num_queries(), 'Should result in another database query.' );
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ class Tests_Post_GetPageByTitle extends WP_UnitTestCase {
|
||||
|
||||
$found = get_page_by_title( 'bar' );
|
||||
$this->assertSame( $page, $found->ID, 'Should find a page with the new title.' );
|
||||
$num_queries++;
|
||||
++$num_queries;
|
||||
$this->assertSame( $num_queries, get_num_queries(), 'Should result in another database query.' );
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ class Tests_Post_GetPageByTitle extends WP_UnitTestCase {
|
||||
$this->assertSame( $num_queries, get_num_queries(), 'Should not result in another database query.' );
|
||||
|
||||
$array_n = get_page_by_title( 'foo', ARRAY_N );
|
||||
$num_queries++; // Add one database query for loading of post metadata.
|
||||
++$num_queries; // Add one database query for loading of post metadata.
|
||||
$this->assertIsArray( $array_n, 'Should be numbric array.' );
|
||||
$this->assertSame( $page, $array_n[0], 'Should match post id.' );
|
||||
$this->assertSame( $num_queries, get_num_queries(), 'Should not result in another database query.' );
|
||||
|
||||
Reference in New Issue
Block a user