/** * ページ指定で取得できるか */ 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); }
public function show($page_num = 1) { $app = \Slim\Slim::getInstance(); list($post_list, $next_page_is_exist) = M_Post::getByPage(10, $page_num); $app->render('TimeLine/show.twig', ['post_list' => $post_list, 'page_num' => $page_num, 'next_page_is_exist' => $next_page_is_exist]); }