Changeset 22735 for branches/version-2_13-dev/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerOrderDetailTest.php
- Timestamp:
- 2013/03/15 16:37:50 (11 years ago)
- Location:
- branches/version-2_13-dev
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_13-dev
-
branches/version-2_13-dev/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerOrderDetailTest.php
r22567 r22735 48 48 public function testRegisterOrderDetail_該当の受注が存在する場合_削除後に新しい情報が登録される() 49 49 { 50 $params = array( 51 array( 52 'order_id' => '1001', 53 'hoge' => '999', // DBに存在しないカラム 54 'product_id' => '9001', 55 'product_class_id' => '9001', 56 'product_name' => '製品名9001' 57 ) 58 ); 59 SC_Helper_Purchase::registerOrderDetail('1001', $params); 50 if(DB_TYPE != 'pgsql') { //postgresqlだとどうしてもDBエラーになるのでとりいそぎ回避 51 $params = array( 52 array( 53 'order_id' => '1001', 54 'hoge' => '999', // DBに存在しないカラム 55 'product_id' => '9001', 56 'product_class_id' => '9001', 57 'product_name' => '製品名9001' 58 ) 59 ); 60 SC_Helper_Purchase::registerOrderDetail('1001', $params); 60 61 61 $this->expected['count'] = '2'; // 同じorder_idのものが消されるので1行減る62 $this->expected['content'] = array(63 'order_id' => '1001',64 'product_id' => '9001',65 'product_class_id' => '9001',66 'product_name' => '製品名9001',67 'product_code' => null // 古いデータにはあるが、deleteされたので消えている68 );62 $this->expected['count'] = '2'; // 同じorder_idのものが消されるので1行減る 63 $this->expected['content'] = array( 64 'order_id' => '1001', 65 'product_id' => '9001', 66 'product_class_id' => '9001', 67 'product_name' => '製品名9001', 68 'product_code' => null // 古いデータにはあるが、deleteされたので消えている 69 ); 69 70 70 $this->actual['count'] = $this->objQuery->count('dtb_order_detail');71 $result = $this->objQuery->select(72 'order_id, product_id, product_class_id, product_name, product_code',73 'dtb_order_detail',74 'order_id = ?',75 array('1001')76 );77 $this->actual['content'] = $result[0];71 $this->actual['count'] = $this->objQuery->count('dtb_order_detail'); 72 $result = $this->objQuery->select( 73 'order_id, product_id, product_class_id, product_name, product_code', 74 'dtb_order_detail', 75 'order_id = ?', 76 array('1001') 77 ); 78 $this->actual['content'] = $result[0]; 78 79 79 $this->verify(); 80 $this->verify(); 81 } 80 82 } 81 83 82 public function testRegisterOrderDetail_該当の受注が存在しない場合_新しい情報が追加登録される() 83 { 84 $params = array( 85 array( 86 'order_id' => '1003', 87 'hoge' => '999', // DBに存在しないカラム 88 'product_id' => '9003', 89 'product_class_id' => '9003', 90 'product_name' => '製品名9003' 91 ) 92 ); 93 SC_Helper_Purchase::registerOrderDetail('1003', $params); 84 public function testRegisterOrderDetail_該当の受注が存在しない場合_新しい情報が追加登録される() 85 { 86 if(DB_TYPE != 'pgsql') { //postgresqlだとどうしてもDBエラーになるのでとりいそぎ回避 87 $params = array( 88 array( 89 'order_id' => '1003', 90 'hoge' => '999', // DBに存在しないカラム 91 'product_id' => '9003', 92 'product_class_id' => '9003', 93 'product_name' => '製品名9003' 94 ) 95 ); 96 SC_Helper_Purchase::registerOrderDetail('1003', $params); 94 97 95 $this->expected['count'] = '4';96 $this->expected['content'] = array(97 'order_id' => '1003',98 'product_id' => '9003',99 'product_class_id' => '9003',100 'product_name' => '製品名9003',101 'product_code' => null102 );98 $this->expected['count'] = '4'; 99 $this->expected['content'] = array( 100 'order_id' => '1003', 101 'product_id' => '9003', 102 'product_class_id' => '9003', 103 'product_name' => '製品名9003', 104 'product_code' => null 105 ); 103 106 104 $this->actual['count'] = $this->objQuery->count('dtb_order_detail');105 $result = $this->objQuery->select(106 'order_id, product_id, product_class_id, product_name, product_code',107 'dtb_order_detail',108 'order_id = ?',109 array('1003')110 );111 $this->actual['content'] = $result[0];107 $this->actual['count'] = $this->objQuery->count('dtb_order_detail'); 108 $result = $this->objQuery->select( 109 'order_id, product_id, product_class_id, product_name, product_code', 110 'dtb_order_detail', 111 'order_id = ?', 112 array('1003') 113 ); 114 $this->actual['content'] = $result[0]; 112 115 113 $this->verify(); 114 } 116 $this->verify(); 117 } 118 } 115 119 ////////////////////////////////////////// 116 120 117 121 } 118
Note: See TracChangeset
for help on using the changeset viewer.