Changeset 34544 for trunk/tests/phpunit/tests/comment/query.php
- Timestamp:
- 09/25/2015 02:34:20 PM (10 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/comment/query.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/query.php
r34310 r34544 1874 1874 1875 1875 } 1876 1877 /** 1878 * @ticket 8071 1879 */ 1880 public function test_no_found_rows_should_default_to_true() { 1881 $comments = $this->factory->comment->create_many( 3, array( 'comment_post_ID' => $this->post_id ) ); 1882 1883 $q = new WP_Comment_Query( array( 1884 'post_id' => $this->post_id, 1885 'number' => 2, 1886 ) ); 1887 1888 $this->assertEquals( 0, $q->found_comments ); 1889 $this->assertEquals( 0, $q->max_num_pages ); 1890 } 1891 1892 /** 1893 * @ticket 8071 1894 */ 1895 public function test_should_respect_no_found_rows_true() { 1896 $comments = $this->factory->comment->create_many( 3, array( 'comment_post_ID' => $this->post_id ) ); 1897 1898 $q = new WP_Comment_Query( array( 1899 'post_id' => $this->post_id, 1900 'number' => 2, 1901 'no_found_rows' => true, 1902 ) ); 1903 1904 $this->assertEquals( 0, $q->found_comments ); 1905 $this->assertEquals( 0, $q->max_num_pages ); 1906 } 1907 1908 /** 1909 * @ticket 8071 1910 */ 1911 public function test_should_respect_no_found_rows_false() { 1912 $comments = $this->factory->comment->create_many( 3, array( 'comment_post_ID' => $this->post_id ) ); 1913 1914 $q = new WP_Comment_Query( array( 1915 'post_id' => $this->post_id, 1916 'number' => 2, 1917 'no_found_rows' => false, 1918 ) ); 1919 1920 $this->assertEquals( 3, $q->found_comments ); 1921 $this->assertEquals( 2, $q->max_num_pages ); 1922 } 1876 1923 }
Note: See TracChangeset
for help on using the changeset viewer.