Ejemplo n.º 1
0
 /**
  * 現在のページ番号が正しいか
  */
 public function testPagingNum()
 {
     \Tinitter\Test\Farming::farmingPost(25);
     $dom = $this->req_dom('/');
     $this->assertEquals('1', $dom->find('.page-num', 0)->text);
     $dom = $this->req_dom('/page/2');
     $this->assertEquals('2', $dom->find('.page-num', 0)->text);
 }
Ejemplo n.º 2
0
 /**
  * ページ指定で取得できるか
  */
 public function testGetByPage()
 {
     \Tinitter\Test\Farming::farmingPost(35);
     list($post_list, $next_page_is_exist) = M_Post::getByPage(10, 1);
     $this->assertCount(10, $post_list);
     $this->assertTrue($next_page_is_exist);
     list($post_list, $next_page_is_exist) = M_Post::getByPage(10, 4);
     $this->assertCount(5, $post_list);
     $this->assertFalse($next_page_is_exist);
     list($post_list, $next_page_is_exist) = M_Post::getByPage(10, 5);
     $this->assertCount(0, $post_list);
     $this->assertFalse($next_page_is_exist);
 }