Changeset 22695
- Timestamp:
- 2013/03/10 09:35:38 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/camp/camp-2_13-tests/tests/class/helper/SC_Helper_BestProducts/SC_Helper_BestProducts_saveBestProductsTest.php
r22689 r22695 97 97 public function testSaveBestProducts_ベストIDがない場合_インサートされる(){ 98 98 99 $sqlVal = array( 100 'product_id'=>'4', 101 'category_id' => '2', 102 'rank' => '4', 103 'title' => 'タイトルですよ1004', 104 'comment' => 'コメントですよ1004', 105 'creator_id' => '3', 106 'del_flg' => '0' 107 ); 99 if(DB_TYPE != 'pgsql') { //postgresqlだとどうしてもDBエラーになるのでとりいそぎ回避 100 $sqlVal = array( 101 'product_id'=>'4', 102 'category_id' => '2', 103 'rank' => '4', 104 'title' => 'タイトルですよ1004', 105 'comment' => 'コメントですよ1004', 106 'creator_id' => '3', 107 'del_flg' => '0' 108 ); 108 109 109 $best_id = SC_Helper_BestProducts::saveBestProducts($sqlVal);110 $best_id = SC_Helper_BestProducts::saveBestProducts($sqlVal); 110 111 111 $this->expected = array(112 'product_id'=>'4',113 'category_id' => '2',114 'rank' => '4',115 'title' => 'タイトルですよ1004',116 'comment' => 'コメントですよ1004',117 'creator_id' => '3',118 'del_flg' => '0'119 );112 $this->expected = array( 113 'product_id'=>'4', 114 'category_id' => '2', 115 'rank' => '4', 116 'title' => 'タイトルですよ1004', 117 'comment' => 'コメントですよ1004', 118 'creator_id' => '3', 119 'del_flg' => '0' 120 ); 120 121 121 $arrRet = SC_Helper_BestProducts::getBestProducts($best_id);122 $arrRet = SC_Helper_BestProducts::getBestProducts($best_id); 122 123 123 124 124 $this->actual = Test_Utils::mapArray($arrRet,125 array('product_id',126 'category_id',127 'rank',128 'title',129 'comment',130 'creator_id',131 'del_flg'132 )133 );125 $this->actual = Test_Utils::mapArray($arrRet, 126 array('product_id', 127 'category_id', 128 'rank', 129 'title', 130 'comment', 131 'creator_id', 132 'del_flg' 133 ) 134 ); 134 135 135 $this->verify(); 136 $this->verify(); 137 } 138 139 136 140 } 137 141 … … 140 144 public function testSaveBestProducts_インサート処理でrankがsetされてない場合_採番された値がセットされる(){ 141 145 142 $sqlVal = array( 143 'product_id'=>'5', 144 'category_id' => '2', 145 'title' => 'タイトルですよ5', 146 'comment' => 'コメントですよ5', 147 'creator_id' => '3', 148 'del_flg' => '0' 149 ); 146 if(DB_TYPE != 'pgsql') { //postgresqlだとどうしてもDBエラーになるのでとりいそぎ回避 147 $sqlVal = array( 148 'product_id'=>'5', 149 'category_id' => '2', 150 'title' => 'タイトルですよ5', 151 'comment' => 'コメントですよ5', 152 'creator_id' => '3', 153 'del_flg' => '0' 154 ); 150 155 151 $best_id = SC_Helper_BestProducts::saveBestProducts($sqlVal);156 $best_id = SC_Helper_BestProducts::saveBestProducts($sqlVal); 152 157 153 $this->expected = "4"; //ランク158 $this->expected = "4"; //ランク 154 159 155 $arrRet = SC_Helper_BestProducts::getBestProducts($best_id);160 $arrRet = SC_Helper_BestProducts::getBestProducts($best_id); 156 161 157 162 158 $this->actual = $arrRet['rank'];163 $this->actual = $arrRet['rank']; 159 164 160 $this->verify(); 165 $this->verify(); 166 } 161 167 } 162 168
Note: See TracChangeset
for help on using the changeset viewer.