public function testGetOrderTemp_存在する受注IDを指定した場合_対応する結果が取得できる() { $order_temp_id = '1002'; $this->expected = array('order_temp_id' => '1002', 'customer_id' => '1002', 'order_name01' => '受注情報02'); $result = SC_Helper_Purchase::getOrderTemp($order_temp_id); $this->actual = Test_Utils::mapArray($result, array('order_temp_id', 'customer_id', 'order_name01')); $this->verify(); }
public function testGetByRank_ランクが存在かつ_has_deletedの場合_対応した結果が返る() { $rank = '2'; $this->expected = array('best_id' => '1002', 'category_id' => '0', 'title' => 'タイトルですよ', 'comment' => 'コメントですよ', 'del_flg' => '1'); $result = SC_Helper_BestProducts_Ex::getByRank($rank, true); $this->actual = Test_Utils::mapArray($result, array('best_id', 'category_id', 'title', 'comment', 'del_flg')); $this->verify(); }
public function testGetByName_削除済みでかつhas_deletedがtrueの場合_対応した結果が返る() { $best_id = '1002'; $this->expected = array('maker_id' => '1002', 'name' => 'パソナニック', 'rank' => '2', 'creator_id' => '2', 'create_date' => '2000-01-01 00:00:00', 'update_date' => '2000-01-01 00:00:00', 'del_flg' => '1'); $result = $this->objHelperMaker->getMaker("1002", true); $this->actual = Test_Utils::mapArray($result, array('maker_id', 'name', 'rank', 'creator_id', 'create_date', 'update_date', 'del_flg')); $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 testGetPaymentsByPaymentsId_存在する支払IDを指定した場合_対応する支払方法の情報が取得できる() { $payment_id = '1001'; $this->expected = array('payment_id' => '1001', 'payment_method' => '支払方法1001'); $helper = new SC_Helper_Purchase(); $this->actual = $helper->getPaymentsByPaymentsId($payment_id); $this->actual = Test_Utils::mapArray($this->actual, array('payment_id', 'payment_method')); $this->verify('支払方法'); }
public function testGet_存在するニュースIDを指定した場合_対応する結果が取得できる() { $this->setUpNews(); $news_id = '1001'; $this->expected = array('update_date' => '2000-01-01 00:00:00', 'news_id' => '1001', 'news_title' => 'ニュース情報01', 'creator_id' => '1', 'del_flg' => '0'); $result = $this->objNews->getNews($news_id); $this->actual = Test_Utils::mapArray($result, array('update_date', 'news_id', 'news_title', 'creator_id', 'del_flg')); $this->verify(); }
public function testSaveBestProducts_ベストIDがない場合_インサートされる() { if (DB_TYPE != 'pgsql') { //postgresqlだとどうしてもDBエラーになるのでとりいそぎ回避 $sqlVal = array('product_id' => '4', 'category_id' => '2', 'rank' => '4', 'title' => 'タイトルですよ1004', 'comment' => 'コメントですよ1004', 'creator_id' => '3', 'del_flg' => '0'); $best_id = SC_Helper_BestProducts_Ex::saveBestProducts($sqlVal); $this->expected = array('product_id' => '4', 'category_id' => '2', 'rank' => '4', 'title' => 'タイトルですよ1004', 'comment' => 'コメントですよ1004', 'creator_id' => '3', 'del_flg' => '0'); $arrRet = SC_Helper_BestProducts_Ex::getBestProducts($best_id); $this->actual = Test_Utils::mapArray($arrRet, array('product_id', 'category_id', 'rank', 'title', 'comment', 'creator_id', 'del_flg')); $this->verify(); } }
public function testGetList_表示件数1かつページ番号0の場合_対象のニュースが取得できる() { $objQuery =& SC_Query_Ex::getSingletonInstance(); $this->setUpNews(); $dispNumber = 1; $pageNumber = 0; $has_deleted = false; $this->expected = array('update_date' => '2000-01-01 00:00:00', 'news_id' => '1004', 'news_title' => 'ニュース情報04', 'creator_id' => '1', 'del_flg' => '0'); $result = $this->objNews->getList($dispNumber, $pageNumber, $has_deleted); $this->actual = Test_Utils::mapArray($result[0], array('update_date', 'news_id', 'news_title', 'creator_id', 'del_flg')); $this->verify(); }
public function testSaveMaker_メーカーIDがない場合_インサートされる() { //public function testSaveMaker_insert(){ if (DB_TYPE != 'pgsql') { //postgresqlだとどうしてもDBエラーになるのでとりいそぎ回避 $sqlVal = array('name' => 'フジスリー', 'creator_id' => '1', 'del_flg' => '0'); $maker_id = $this->objHelperMaker->saveMaker($sqlVal); $this->expected = array('name' => 'フジスリー', 'rank' => '5', 'creator_id' => '1', 'del_flg' => '0'); $arrRet = $this->objHelperMaker->getMaker($maker_id); $this->actual = Test_Utils::mapArray($arrRet, array('name', 'rank', 'creator_id', 'del_flg')); $this->verify(); } }
public function testGetShippings_商品取得フラグをOFFにした場合_結果に商品情報が含まれない() { $order_id = '1001'; $this->expected['count'] = 1; $this->expected['first'] = array('order_id' => '1001', 'shipping_id' => '1', 'shipping_name01' => '配送情報01', 'shipping_date' => '2012-01-12 00:00:00'); $this->expected['shipment_item_count'] = 0; $helper = new SC_Helper_Purchase(); $result = $helper->getShippings($order_id, false); $this->actual['count'] = count($result); // shipping_idごとの配列になっているのでshipping_idで抽出 $this->actual['first'] = Test_Utils::mapArray($result['1'], array('order_id', 'shipping_id', 'shipping_name01', 'shipping_date')); $this->actual['shipment_item_count'] = count($result['1']['shipment_item']); $this->verify('配送情報'); }
public function testGetDeliv_存在する商品種別IDを指定した場合_結果が正しい順序で取得できる() { $product_type_id = '1001'; $this->expected['count'] = 2; $this->expected['first'] = array('deliv_id' => '1002', 'product_type_id' => '1001', 'name' => '配送業者02', 'rank' => '3'); $this->expected['second'] = array('deliv_id' => '1001', 'product_type_id' => '1001', 'name' => '配送業者01', 'rank' => '2'); $helper = new SC_Helper_Purchase(); $result = $helper->getDeliv($product_type_id); $this->actual['count'] = count($result); $cols = array('deliv_id', 'product_type_id', 'name', 'rank'); $this->actual['first'] = Test_Utils::mapArray($result[0], $cols); $this->actual['second'] = Test_Utils::mapArray($result[1], $cols); $this->verify('配送業者'); }
public function testGetShipmentItems_詳細フラグをOFFにした場合_結果に詳細情報が含まれない() { $order_id = '1'; $shipping_id = '1'; $this->expected['count'] = 2; $this->expected['first'] = array('order_id' => '1', 'shipping_id' => '1', 'product_class_id' => '1001', 'product_name' => '商品名01', 'price' => '1500', 'productsClass' => null); $this->expected['second'] = array('order_id' => '1', 'shipping_id' => '1', 'product_class_id' => '1002', 'product_name' => '商品名02', 'price' => '2400', 'productsClass' => null); $result = SC_Helper_Purchase::getShipmentItems($order_id, $shipping_id, false); $this->actual['count'] = count($result); $this->actual['first'] = Test_Utils::mapArray($result[0], array('order_id', 'shipping_id', 'product_class_id', 'product_name', 'price', 'productsClass')); $this->actual['second'] = Test_Utils::mapArray($result[1], array('order_id', 'shipping_id', 'product_class_id', 'product_name', 'price', 'productsClass')); $this->verify('配送情報'); }