public function testDeleteByProductIDs_複数データが削除される()
 {
     $objHelperBestProducts = new SC_Helper_BestProducts_Ex();
     $objHelperBestProducts->deleteByProductIDs(array("2", "3"));
     $this->expected = null;
     $this->actual = $objHelperBestProducts->getBestProducts('1001');
     $this->verify();
     $this->actual = $objHelperBestProducts->getBestProducts('1003');
     $this->verify();
 }
 public function testDeleteBestProducts_データ削除後_ランクは変動しない()
 {
     SC_Helper_BestProducts_Ex::deleteBestProducts("1001");
     $this->expected = "2";
     $arrRet = SC_Helper_BestProducts_Ex::getBestProducts('1002', true);
     $this->actual = $arrRet['rank'];
     $this->verify();
 }
 public function testRankUp_指定されたデータがランクアップされる()
 {
     SC_Helper_BestProducts_Ex::rankUp("1003");
     $this->expected = "2";
     $arrRet = SC_Helper_BestProducts_Ex::getBestProducts('1003');
     $this->actual = $arrRet['rank'];
     $this->verify();
 }
 public function testGetBestProducts_削除済みでかつhas_deletedがtrueの場合_対応した結果が返る()
 {
     $best_id = '1002';
     $this->expected = array('category_id' => '0', 'rank' => '2', 'title' => 'タイトルですよ', 'comment' => 'コメントですよ', 'del_flg' => '1');
     $result = SC_Helper_BestProducts_Ex::getBestProducts($best_id, true);
     $this->actual = Test_Utils::mapArray($result, array('category_id', 'rank', 'title', 'comment', 'del_flg'));
     $this->verify();
 }
 public function testRankDown_指定されたデータがランクダウンされる()
 {
     SC_Helper_BestProducts_Ex::rankDown("1001");
     $this->expected = "2";
     $arrRet = SC_Helper_BestProducts_Ex::getBestProducts('1001');
     $this->actual = $arrRet['rank'];
     $this->verify();
 }
 public function testRankDown_指定されたデータがランクダウンされる()
 {
     $objRecommend = new SC_Helper_BestProducts_Ex();
     $objRecommend->rankDown("1001");
     $this->expected = "2";
     $arrRet = $objRecommend->getBestProducts('1001');
     $this->actual = $arrRet['rank'];
     $this->verify();
 }
 public function testSaveBestProducts_インサート処理でrankがsetされてない場合_採番された値がセットされる()
 {
     if (DB_TYPE != 'pgsql') {
         //postgresqlだとどうしてもDBエラーになるのでとりいそぎ回避
         $sqlVal = array('product_id' => '5', 'category_id' => '2', 'title' => 'タイトルですよ5', 'comment' => 'コメントですよ5', 'creator_id' => '3', 'del_flg' => '0');
         $best_id = SC_Helper_BestProducts_Ex::saveBestProducts($sqlVal);
         $this->expected = "4";
         //ランク
         $arrRet = SC_Helper_BestProducts_Ex::getBestProducts($best_id);
         $this->actual = $arrRet['rank'];
         $this->verify();
     }
 }