deleteAllBestProducts(); $this->expected = array(); $this->actual = SC_Helper_BestProducts::getList(); $this->verify(); } public function testGetList_データがある場合、想定した結果が返る(){ $this->setUpBestProducts(); $this->expected = array( 0=>array( 'best_id' => '1001', 'product_id'=>'2', 'category_id' => '0', 'rank' => '1', 'title' => 'タイトルですよ', 'comment' => 'コメントですよ', 'creator_id' => '1', 'create_date' => '2000-01-01 00:00:00', 'update_date' => '2000-01-01 00:00:00', 'del_flg' => '0' ), 1=>array( 'best_id' => '1003', 'product_id'=>'3', 'category_id' => '1', 'rank' => '3', 'title' => 'タイトルですよ3', 'comment' => 'コメントですよ3', 'creator_id' => '3', 'create_date' => '2000-01-01 00:00:00', 'update_date' => '2000-01-01 00:00:00', 'del_flg' => '0' ) ); $this->actual = SC_Helper_BestProducts::getList(); $this->verify(); } public function testGetList_一覧取得has_deleteをtrueにした場合削除済みデータも取得(){ $this->setUpBestProducts(); $this->expected = array( 0=>array( 'best_id' => '1001', 'product_id'=>'2', 'category_id' => '0', 'rank' => '1', 'title' => 'タイトルですよ', 'comment' => 'コメントですよ', 'creator_id' => '1', 'create_date' => '2000-01-01 00:00:00', 'update_date' => '2000-01-01 00:00:00', 'del_flg' => '0' ), 1=>array( 'best_id' => '1002', 'product_id'=>'1', 'category_id' => '0', 'rank' => '2', 'title' => 'タイトルですよ', 'comment' => 'コメントですよ', 'creator_id' => '1', 'create_date' => '2000-01-01 00:00:00', 'update_date' => '2000-01-01 00:00:00', 'del_flg' => '1' ), 2=>array( 'best_id' => '1003', 'product_id'=>'3', 'category_id' => '1', 'rank' => '3', 'title' => 'タイトルですよ3', 'comment' => 'コメントですよ3', 'creator_id' => '3', 'create_date' => '2000-01-01 00:00:00', 'update_date' => '2000-01-01 00:00:00', 'del_flg' => '0' ) ); $this->actual = SC_Helper_BestProducts::getList(0,0,true); $this->verify(); } public function testGetList_ページングが想定した結果が返る12(){ $this->setUpBestProducts(); $this->expected = array( 0=>array( 'best_id' => '1003', 'product_id'=>'3', 'category_id' => '1', 'rank' => '3', 'title' => 'タイトルですよ3', 'comment' => 'コメントですよ3', 'creator_id' => '3', 'create_date' => '2000-01-01 00:00:00', 'update_date' => '2000-01-01 00:00:00', 'del_flg' => '0' ) ); $this->actual = SC_Helper_BestProducts::getList(1,2); $this->verify(); } public function testGetList_ページングが想定した結果が返る10(){ $this->setUpBestProducts(); $this->expected = array( 0=>array( 'best_id' => '1001', 'product_id'=>'2', 'category_id' => '0', 'rank' => '1', 'title' => 'タイトルですよ', 'comment' => 'コメントですよ', 'creator_id' => '1', 'create_date' => '2000-01-01 00:00:00', 'update_date' => '2000-01-01 00:00:00', 'del_flg' => '0' ) ); $this->actual = SC_Helper_BestProducts::getList(1,0); $this->verify(); } }