| 1 | <?php |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | class Customer_test extends TestCase |
| 12 | { |
| 13 | |
| 14 | |
| 15 | |
| 16 | public function __construct() { |
| 17 | parent::__construct(); |
| 18 | $ci = &get_instance(); |
| 19 | $ci->load->database(); |
| 20 | $ci->load->helper('validator_helper'); |
| 21 | $this->code = substr(md5(uniqid(mt_rand(), true)), 0, 5); |
| 22 | $_SESSION =array ( |
| 23 | '__ci_last_regenerate' => 1674475513, |
| 24 | 'lang' => 'th', |
| 25 | 'tLangID' => 1, |
| 26 | 'tSesUserLogin' => '009', |
| 27 | 'tSesUsrRoleCodeMulti' => '\'00002\'', |
| 28 | 'nSesUsrRoleLevel' => 99, |
| 29 | 'tSesUsrAgnCode' => NULL, |
| 30 | 'tSesUsrAgnName' => NULL, |
| 31 | 'tSesUsrMerCode' => NULL, |
| 32 | 'tSesUsrMerName' => NULL, |
| 33 | 'tSesUsrBchCodeDefault' => '00001', |
| 34 | 'tSesUsrBchNameDefault' => 'AdaSoft00001', |
| 35 | 'tSesUsrBchCodeMulti' => '\'00001\'', |
| 36 | 'tSesUsrBchNameMulti' => '\'AdaSoft00001\'', |
| 37 | 'nSesUsrBchCount' => 0, |
| 38 | 'tSesUsrShpCodeDefault' => '00014', |
| 39 | 'tSesUsrShpNameDefault' => 'รันไทม์ช็อป', |
| 40 | 'tSesUsrShpCodeMulti' => '\'00014\'', |
| 41 | 'tSesUsrShpNameMulti' => '\'รันไทม์ช็อป\'', |
| 42 | 'nSesUsrShpCount' => 0, |
| 43 | 'tSesUsrWahCode' => '00001', |
| 44 | 'tSesUsrWahName' => 'คลังขาย', |
| 45 | 'tSesUsrLoginLevel' => 'HQ', |
| 46 | 'tSesUsrLoginAgency' => 0, |
| 47 | 'bSesLogIn' => 1, |
| 48 | 'tSesUserCode' => '00002', |
| 49 | 'tSesUsername' => '00002', |
| 50 | 'tSesUsrDptName' => NULL, |
| 51 | 'tSesUsrDptCode' => NULL, |
| 52 | 'tSesUsrUsername' => 'Adasoft', |
| 53 | 'tSesUsrImagePerson' => NULL, |
| 54 | 'tSesUsrInfo' => |
| 55 | array ( |
| 56 | 'FTUsrStaActive' => 1, |
| 57 | 'FTUsrLogType' => 1, |
| 58 | 'FTStaError' => 0, |
| 59 | 'FTUsrCode' => '00002', |
| 60 | 'FTUsrName' => 'Adasoft', |
| 61 | 'FTDptCode' => NULL, |
| 62 | 'FTDptName' => NULL, |
| 63 | 'FTImgObj' => NULL, |
| 64 | ), |
| 65 | 'tSesUsrGroup' => |
| 66 | array ( |
| 67 | 0 => |
| 68 | array ( |
| 69 | 'FTUsrCode' => '00002', |
| 70 | 'FTAgnCode' => NULL, |
| 71 | 'FTAgnName' => NULL, |
| 72 | 'FTBchCode' => NULL, |
| 73 | 'FTBchName' => NULL, |
| 74 | 'FTShpCode' => NULL, |
| 75 | 'FTShpName' => NULL, |
| 76 | 'FTMerCode' => NULL, |
| 77 | 'FTMerName' => NULL, |
| 78 | 'FTWahCode' => NULL, |
| 79 | 'FTWahName' => NULL, |
| 80 | 'FTLoginLevel' => 'HQ', |
| 81 | 'FTStaLoginAgn' => 0, |
| 82 | ), |
| 83 | ), |
| 84 | 'tSesSessionID' => '0000220230123185822', |
| 85 | 'tSesSessionDate' => '2023-01-23 18:58:22', |
| 86 | 'tLangEdit' => 1, |
| 87 | 'bIsHaveAgn' => NULL, |
| 88 | 'tSesUsrLevel' => 'HQ', |
| 89 | 'tSesUsrRoleSpcCodeMulti' => '\'00002\',\'00003\',\'00004\',\'00005\',\'00006\',\'00007\',\'00008\',\'00009\',\'00010\',\'00011\',\'00012\',\'00013\',\'00014\',\'00016\',\'00017\',\'00018\',\'00019\',\'00020\',\'00021\',\'00022\',\'00023\',\'00024\',\'00025\',\'00026\',\'00027\',\'00028\',\'00029\',\'00030\',\'00031\',\'00032\',\'00033\',\'00034\',\'00035\',\'00036\',\'00037\',\'00038\'', |
| 90 | 'bShpEnabled' => 1, |
| 91 | 'bAgnEnabled' => 1, |
| 92 | 'bLockerEnabled' => NULL, |
| 93 | 'bPdtFasionEnabled' => NULL, |
| 94 | 'tSesHQBchCode' => '00001', |
| 95 | 'bSesRegStaLicense' => 1, |
| 96 | 'tSesCstKey' => '52a8a4705e6c', |
| 97 | 'bSesRegStaBuyPackage' => 1, |
| 98 | ); |
| 99 | |
| 100 | |
| 101 | } |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | public function test_เข้าหน้าแรกต้องสำเร็จ(){ |
| 126 | print "test_เข้าหน้าแรกต้องสำเร็จ\n"; |
| 127 | $oOutput = $this->request( |
| 128 | 'POST', |
| 129 | 'customer/customer/cCustomer/index/0/0' |
| 130 | ); |
| 131 | $this->assertStringContainsString('oetCstStaBrowse', $oOutput); |
| 132 | $this->assertResponseCode(200); |
| 133 | } |
| 134 | |
| 135 | |
| 136 | |
| 137 | public function test_เข้าหน้าหลักต้องสำเร็จ(){ |
| 138 | print "test_เข้าหน้าหลักต้องสำเร็จ\n"; |
| 139 | $oOutput = $this->request( |
| 140 | 'POST', |
| 141 | 'customer/customer/cCustomer/FSvCSTListPage' |
| 142 | ); |
| 143 | $this->assertStringContainsString('odvMngTableList', $oOutput); |
| 144 | $this->assertResponseCode(200); |
| 145 | } |
| 146 | |
| 147 | |
| 148 | public function test_โหลดข้อมูลมาแสดงเป็นตารางต้องสำเร็จ(){ |
| 149 | print "test_โหลดข้อมูลมาแสดงเป็นตารางต้องสำเร็จ\n"; |
| 150 | $oOutput = $this->request( |
| 151 | 'POST', |
| 152 | 'customer/customer/cCustomer/FSvCSTDataList' |
| 153 | ); |
| 154 | $this->assertStringContainsString('table-responsive', $oOutput); |
| 155 | $this->assertResponseCode(200); |
| 156 | } |
| 157 | |
| 158 | |
| 159 | |
| 160 | public function test_โหลดข้อมูลมาแสดงเป็นตารางต้องสำเร็จ_แบบมีเงื่อนไข_ตัวกรอง(){ |
| 161 | print "test_โหลดข้อมูลมาแสดงเป็นตารางต้องสำเร็จ_แบบมีเงื่อนไข_ตัวกรอง\n"; |
| 162 | $aParam = array( |
| 163 | 'tSearchAll' => 'กันติทัต', |
| 164 | 'nPageCurrent' => '1', |
| 165 | ); |
| 166 | $oOutput = $this->request( |
| 167 | 'POST', |
| 168 | 'customer/customer/cCustomer/FSvCSTDataList', |
| 169 | $aParam |
| 170 | ); |
| 171 | $this->assertStringContainsString('table-responsive', $oOutput); |
| 172 | $this->assertResponseCode(200); |
| 173 | } |
| 174 | |
| 175 | |
| 176 | public function test_โหลดข้อมูลมาแสดงเป็นตารางต้องสำเร็จ_แบบมีเงื่อนไข_หน้า_2(){ |
| 177 | print "test_โหลดข้อมูลมาแสดงเป็นตารางต้องสำเร็จ_แบบมีเงื่อนไข_หน้า_2\n"; |
| 178 | $aParam = array( |
| 179 | 'tSearchAll' => '', |
| 180 | 'nPageCurrent' => '2', |
| 181 | ); |
| 182 | $oOutput = $this->request( |
| 183 | 'POST', |
| 184 | 'customer/customer/cCustomer/FSvCSTDataList', |
| 185 | $aParam |
| 186 | ); |
| 187 | $this->assertStringContainsString('table-responsive', $oOutput); |
| 188 | $this->assertResponseCode(200); |
| 189 | } |
| 190 | |
| 191 | |
| 192 | |
| 193 | public function test_โหลดข้อมูลมาแสดงเป็นตารางต้องสำเร็จ_แบบมีเงื่อนไข_ตัวกรอง_หน้า_2(){ |
| 194 | print "test_โหลดข้อมูลมาแสดงเป็นตารางต้องสำเร็จ_แบบมีเงื่อนไข_ตัวกรอง_หน้า_2\n"; |
| 195 | $aParam = array( |
| 196 | 'tSearchAll' => 'กันติทัต', |
| 197 | 'nPageCurrent' => '2', |
| 198 | ); |
| 199 | $oOutput = $this->request( |
| 200 | 'POST', |
| 201 | 'customer/customer/cCustomer/FSvCSTDataList', |
| 202 | $aParam |
| 203 | ); |
| 204 | $this->assertStringContainsString('table-responsive', $oOutput); |
| 205 | $this->assertResponseCode(200); |
| 206 | } |
| 207 | |
| 208 | |
| 209 | |
| 210 | public function test_โหลดข้อมูลหน้าเพิ่มมาสเตอร์(){ |
| 211 | print "test_โหลดข้อมูลหน้าเพิ่มมาสเตอร์\n"; |
| 212 | $oOutput = $this->request( |
| 213 | 'POST', |
| 214 | 'customer/customer/cCustomer/FSvCSTAddPage' |
| 215 | ); |
| 216 | $this->assertStringContainsString('odvActionSubMenu', $oOutput); |
| 217 | $this->assertResponseCode(200); |
| 218 | } |
| 219 | |
| 220 | |
| 221 | |
| 222 | |
| 223 | public function test_เพิ่มข้อมูลมาสเตอร์แบบสร้างรหัสอัตโนมัติ(){ |
| 224 | print "test_เพิ่มข้อมูลมาสเตอร์แบบสร้างรหัสอัตโนมัติ\n"; |
| 225 | $aParam = array( |
| 226 | 'ohdImgObj' => '', |
| 227 | 'ohdImgObjOld' => '', |
| 228 | 'ohdRetionCropper' => '0', |
| 229 | 'oetImgInputCustomerOld' => '', |
| 230 | 'oetImgInputCustomer' => '', |
| 231 | 'ocbCustomerAutoGenCode' => '1', |
| 232 | 'ohdCheckDuplicateCstCode' => '1', |
| 233 | 'oetCstAgnCode' => '', |
| 234 | 'oetCstAgnName' => '', |
| 235 | 'oetCstName' => 'เทปใสมายแคท', |
| 236 | 'oetCstIdenNum' => '15013510202', |
| 237 | 'oetCstBirthday' => '2023-03-03', |
| 238 | 'orbCstSex' => '1', |
| 239 | 'orbCstBusiness' => '1', |
| 240 | 'oetCstTaxIdenNum' => '', |
| 241 | 'oetCstTel' => '069490904', |
| 242 | 'oetCstEmail' => 'admin2@gmail.com', |
| 243 | 'otaCstRemark' => '', |
| 244 | 'ocbCstStaAlwPosCalSo' => '1', |
| 245 | 'ocbCstStaActive' => '1', |
| 246 | 'oetCstCgpCode' => '', |
| 247 | 'oetCstCgpName' => '', |
| 248 | 'oetCstCtyCode' => '', |
| 249 | 'oetCstCtyName' => '', |
| 250 | 'oetCstClvCode' => '00002', |
| 251 | 'oetCstClvName' => 'ทดสอบระดับลูกค้า001', |
| 252 | 'oetCstCstOcpCode' => '', |
| 253 | 'oetCstCstOcpName' => '', |
| 254 | 'oetCstPplRetCode' => '', |
| 255 | 'oetCstPplRetName' => '', |
| 256 | 'oetCstPmgCode' => '', |
| 257 | 'oetCstPmgName' => '', |
| 258 | 'oetCstDiscRet' => '', |
| 259 | 'oetCstBchCode' => '00001', |
| 260 | 'oetCstBchName' => 'AdaSoft00001', |
| 261 | ); |
| 262 | $oOutput = $this->request( |
| 263 | 'POST', |
| 264 | 'customer/customer/cCustomer/FSaCSTAddEvent', |
| 265 | $aParam |
| 266 | ); |
| 267 | $this->assertStringContainsString('Success Add Event', $oOutput); |
| 268 | $this->assertResponseCode(200); |
| 269 | } |
| 270 | |
| 271 | |
| 272 | |
| 273 | |
| 274 | |
| 275 | public function test_เพิ่มข้อมูลมาสเตอร์แบบสร้างรหัสด้วยตัวเอง_ด้วยข้อมูลรหัสยังไม่มีอยู่ในระบบ(){ |
| 276 | print "test_เพิ่มข้อมูลมาสเตอร์แบบสร้างรหัสด้วยตัวเอง_ด้วยข้อมูลรหัสยังไม่มีอยู่ในระบบ\n"; |
| 277 | $aParam = array( |
| 278 | 'ohdImgObj' => '', |
| 279 | 'ohdImgObjOld' => '', |
| 280 | 'ohdRetionCropper' => '0', |
| 281 | 'oetImgInputCustomerOld' => '', |
| 282 | 'oetImgInputCustomer' => '', |
| 283 | 'ocbCustomerAutoGenCode' => '2', |
| 284 | 'ohdCheckDuplicateCstCode' => '1', |
| 285 | 'oetCstAgnCode' => '', |
| 286 | 'oetCstAgnName' => '', |
| 287 | 'oetCstCode' => $this->code, |
| 288 | 'oetCstName' => $this->code.'- เทปใสมายแคท', |
| 289 | 'oetCstIdenNum' => '15013510202', |
| 290 | 'oetCstBirthday' => '2023-03-03', |
| 291 | 'orbCstSex' => '1', |
| 292 | 'orbCstBusiness' => '1', |
| 293 | 'oetCstTaxIdenNum' => '', |
| 294 | 'oetCstTel' => '069490904', |
| 295 | 'oetCstEmail' => 'admin2@gmail.com', |
| 296 | 'otaCstRemark' => '', |
| 297 | 'ocbCstStaAlwPosCalSo' => '1', |
| 298 | 'ocbCstStaActive' => '1', |
| 299 | 'oetCstCgpCode' => '', |
| 300 | 'oetCstCgpName' => '', |
| 301 | 'oetCstCtyCode' => '', |
| 302 | 'oetCstCtyName' => '', |
| 303 | 'oetCstClvCode' => '00002', |
| 304 | 'oetCstClvName' => 'ทดสอบระดับลูกค้า001', |
| 305 | 'oetCstCstOcpCode' => '', |
| 306 | 'oetCstCstOcpName' => '', |
| 307 | 'oetCstPplRetCode' => '', |
| 308 | 'oetCstPplRetName' => '', |
| 309 | 'oetCstPmgCode' => '', |
| 310 | 'oetCstPmgName' => '', |
| 311 | 'oetCstDiscRet' => '', |
| 312 | 'oetCstBchCode' => '00001', |
| 313 | 'oetCstBchName' => 'AdaSoft00001', |
| 314 | ); |
| 315 | $oOutput = $this->request( |
| 316 | 'POST', |
| 317 | 'customer/customer/cCustomer/FSaCSTAddEvent', |
| 318 | $aParam |
| 319 | ); |
| 320 | $this->assertStringContainsString('Success Add Event', $oOutput); |
| 321 | $this->assertResponseCode(200); |
| 322 | } |
| 323 | |
| 324 | |
| 325 | |
| 326 | public function test_เพิ่มข้อมูลมาสเตอร์แบบสร้างรหัสด้วยตัวเอง_แบบรหัสซ้ำกับในระบบอยุ่แล้ว(){ |
| 327 | print "test_เพิ่มข้อมูลมาสเตอร์แบบสร้างรหัสด้วยตัวเอง_แบบรหัสซ้ำกับในระบบอยุ่แล้ว\n"; |
| 328 | $ci = &get_instance(); |
| 329 | $ci->load->database(); |
| 330 | $aResult = $ci->db->select('FTCstCode')->limit(1)->get('TCNMCst')->row_array(); |
| 331 | if(!empty($aResult)){ |
| 332 | $aParam = array( |
| 333 | 'ohdImgObj' => '', |
| 334 | 'ohdImgObjOld' => '', |
| 335 | 'ohdRetionCropper' => '0', |
| 336 | 'oetImgInputCustomerOld' => '', |
| 337 | 'oetImgInputCustomer' => '', |
| 338 | 'ocbCustomerAutoGenCode' => '2', |
| 339 | 'ohdCheckDuplicateCstCode' => '1', |
| 340 | 'oetCstAgnCode' => '', |
| 341 | 'oetCstAgnName' => '', |
| 342 | 'oetCstCode' => $aResult['FTCstCode'], |
| 343 | 'oetCstName' => $aResult['FTCstCode'].'- เทปใสมายแคท', |
| 344 | 'oetCstIdenNum' => '15013510202', |
| 345 | 'oetCstBirthday' => '2023-03-03', |
| 346 | 'orbCstSex' => '1', |
| 347 | 'orbCstBusiness' => '1', |
| 348 | 'oetCstTaxIdenNum' => '', |
| 349 | 'oetCstTel' => '069490904', |
| 350 | 'oetCstEmail' => 'admin2@gmail.com', |
| 351 | 'otaCstRemark' => '', |
| 352 | 'ocbCstStaAlwPosCalSo' => '1', |
| 353 | 'ocbCstStaActive' => '1', |
| 354 | 'oetCstCgpCode' => '', |
| 355 | 'oetCstCgpName' => '', |
| 356 | 'oetCstCtyCode' => '', |
| 357 | 'oetCstCtyName' => '', |
| 358 | 'oetCstClvCode' => '00002', |
| 359 | 'oetCstClvName' => 'ทดสอบระดับลูกค้า001', |
| 360 | 'oetCstCstOcpCode' => '', |
| 361 | 'oetCstCstOcpName' => '', |
| 362 | 'oetCstPplRetCode' => '', |
| 363 | 'oetCstPplRetName' => '', |
| 364 | 'oetCstPmgCode' => '', |
| 365 | 'oetCstPmgName' => '', |
| 366 | 'oetCstDiscRet' => '', |
| 367 | 'oetCstBchCode' => '00001', |
| 368 | 'oetCstBchName' => 'AdaSoft00001', |
| 369 | ); |
| 370 | |
| 371 | $oOutput = $this->request( |
| 372 | 'POST', |
| 373 | 'customer/customer/cCustomer/FSaCSTAddEvent', |
| 374 | $aParam |
| 375 | ); |
| 376 | $this->assertStringContainsString('Data Code Duplicate', $oOutput); |
| 377 | $this->assertResponseCode(200); |
| 378 | } |
| 379 | } |
| 380 | |
| 381 | |
| 382 | |
| 383 | public function test_โหลดข้อมูลมาแสดงเป็นตารางต้องสำเร็จ_แบบมีเงื่อนไข_ตัวกรอง_ด้วยรหัสบัตรลูกค้า(){ |
| 384 | print "test_โหลดข้อมูลมาแสดงเป็นตารางต้องสำเร็จ_แบบมีเงื่อนไข_ตัวกรอง_ด้วยรหัสบัตรลูกค้า\n"; |
| 385 | $aParam = array( |
| 386 | 'tSearchAll' => 'NATTAKSD001', |
| 387 | 'nPageCurrent' => '1', |
| 388 | ); |
| 389 | $oOutput = $this->request( |
| 390 | 'POST', |
| 391 | 'customer/customer/cCustomer/FSvCSTDataList', |
| 392 | $aParam |
| 393 | ); |
| 394 | $this->assertStringContainsString('7448c- เทปใสมายแคท', $oOutput); |
| 395 | $this->assertResponseCode(200); |
| 396 | } |
| 397 | |
| 398 | |
| 399 | public function test_โหลดข้อมูลที่อยู่ของลูกค้ามาแสดง(){ |
| 400 | print "test_โหลดข้อมูลที่อยู่ของลูกค้ามาแสดง\n"; |
| 401 | $aParam = array( |
| 402 | 'ptCutomerCode'=> '00001' |
| 403 | ); |
| 404 | $oOutput = $this->request( |
| 405 | 'POST', |
| 406 | 'customer/customer/cCustomerAddress/FSvCCSTAddressDataTable', |
| 407 | $aParam |
| 408 | ); |
| 409 | $this->assertStringContainsString('otbCustomerAddressTableList', $oOutput); |
| 410 | $this->assertResponseCode(200); |
| 411 | } |
| 412 | |
| 413 | |
| 414 | |
| 415 | public function test_เพิ่มที่อยู่ลูกค้าแบบกรอกที่อยู่แบบรวมและกรอกยาวเต็ม255ตัวอักษร(){ |
| 416 | print "test_เพิ่มที่อยู่ลูกค้าแบบกรอกที่อยู่แบบรวมและกรอกยาวเต็ม255ตัวอักษร\n"; |
| 417 | $aParam = array( |
| 418 | 'ohdCSTAddressRoute' => 'customerAddressEditEvent', |
| 419 | 'ohdCSTAddressCstCode' => '00001', |
| 420 | 'ohdCSTAddressVersion' => '2', |
| 421 | 'ohdCSTAddressGrpType' => '1', |
| 422 | 'ohdCSTAddressSeqNo' => '12', |
| 423 | 'ohdCSTAddressRefNo' => '1', |
| 424 | 'ohdCSTAddressMapLong' => '', |
| 425 | 'ohdCSTAddressMapLat' => '', |
| 426 | 'oetCstAddressName' => 'test', |
| 427 | 'ocmCstGrpType' => '1', |
| 428 | 'oetCstAddAddress1' => '36/21 เอื้ออาทรบึงกุ่ม ซอยเสรีไทย 43 ถนนเสรีไทย คลองกุ่ม บึงกุ่ม กรุงเทพฯ 36/21 เอื้ออาทรบึงกุ่ม ซอยเสรีไทย 43 ถนนเสรีไทย คลองกุ่ม บึงกุ่ม กรุงเทพฯ 36/21 เอื้ออาทรบึงกุ่ม ซอยเสรีไทย 43 ถนนเสรีไทย คลองกุ่ม บึงกุ่ม กรุงเทพฯ 36/21 เอื้ออาทรบึงกุ่ม ซอยเสรีไทย', |
| 429 | 'oetCstAddAddress2' => '36/21 เอื้ออาทรบึงกุ่ม ซอยเสรีไทย 43 ถนนเสรีไทย คลองกุ่ม บึงกุ่ม กรุงเทพฯ 36/21 เอื้ออาทรบึงกุ่ม ซอยเสรีไทย 43 ถนนเสรีไทย คลองกุ่ม บึงกุ่ม กรุงเทพฯ 36/21 เอื้ออาทรบึงกุ่ม ซอยเสรีไทย 43 ถนนเสรีไทย คลองกุ่ม บึงกุ่ม กรุงเทพฯ 36/21 เอื้ออาทรบึงกุ่ม ซอยเสรีไทย', |
| 430 | 'oetCstAddWeb' => '', |
| 431 | 'oetCSTAddressTel' => '', |
| 432 | 'oetCSTAddressFax' => '', |
| 433 | 'oetCstAddressRmk' => '', |
| 434 | ); |
| 435 | $oOutput = $this->request( |
| 436 | 'POST', |
| 437 | 'customer/customer/cCustomerAddress/FSoCCSTAddressAddEvent', |
| 438 | $aParam |
| 439 | ); |
| 440 | $this->assertStringContainsString('Success Add Shop Address.', $oOutput); |
| 441 | $this->assertResponseCode(200); |
| 442 | } |
| 443 | |
| 444 | |
| 445 | |
| 446 | public function test_แก้ไขที่อยู่ลูกค้าแบบกรอกที่อยู่แบบรวมและกรอกยาวเต็ม255ตัวอักษร(){ |
| 447 | print "test_แก้ไขที่อยู่ลูกค้าแบบกรอกที่อยู่แบบรวมและกรอกยาวเต็ม255ตัวอักษร\n"; |
| 448 | $aParam = array( |
| 449 | 'ohdCSTAddressRoute' => 'customerAddressEditEvent', |
| 450 | 'ohdCSTAddressCstCode' => '00001', |
| 451 | 'ohdCSTAddressVersion' => '2', |
| 452 | 'ohdCSTAddressGrpType' => '1', |
| 453 | 'ohdCSTAddressSeqNo' => '12', |
| 454 | 'ohdCSTAddressRefNo' => '1', |
| 455 | 'ohdCSTAddressMapLong' => '', |
| 456 | 'ohdCSTAddressMapLat' => '', |
| 457 | 'oetCstAddressName' => 'test', |
| 458 | 'ocmCstGrpType' => '1', |
| 459 | 'oetCstAddAddress1' => '36/21 เอื้ออาทรบึงกุ่ม ซอยเสรีไทย 43 ถนนเสรีไทย คลองกุ่ม บึงกุ่ม กรุงเทพฯ 36/21 เอื้ออาทรบึงกุ่ม ซอยเสรีไทย 43 ถนนเสรีไทย คลองกุ่ม บึงกุ่ม กรุงเทพฯ 36/21 เอื้ออาทรบึงกุ่ม ซอยเสรีไทย 43 ถนนเสรีไทย คลองกุ่ม บึงกุ่ม กรุงเทพฯ 36/21 เอื้ออาทรบึงกุ่ม ซอยเสรีไทย', |
| 460 | 'oetCstAddAddress2' => '36/21 เอื้ออาทรบึงกุ่ม ซอยเสรีไทย 43 ถนนเสรีไทย คลองกุ่ม บึงกุ่ม กรุงเทพฯ 36/21 เอื้ออาทรบึงกุ่ม ซอยเสรีไทย 43 ถนนเสรีไทย คลองกุ่ม บึงกุ่ม กรุงเทพฯ 36/21 เอื้ออาทรบึงกุ่ม ซอยเสรีไทย 43 ถนนเสรีไทย คลองกุ่ม บึงกุ่ม กรุงเทพฯ 36/21 เอื้ออาทรบึงกุ่ม ซอยเสรีไทย', |
| 461 | 'oetCstAddWeb' => '', |
| 462 | 'oetCSTAddressTel' => '', |
| 463 | 'oetCSTAddressFax' => '', |
| 464 | 'oetCstAddressRmk' => '', |
| 465 | ); |
| 466 | $oOutput = $this->request( |
| 467 | 'POST', |
| 468 | 'customer/customer/cCustomerAddress/FSoCCSTAddressEditEvent', |
| 469 | $aParam |
| 470 | ); |
| 471 | $this->assertStringContainsString('Success Update Customer Address', $oOutput); |
| 472 | $this->assertResponseCode(200); |
| 473 | } |
| 474 | |
| 475 | |
| 476 | |
| 477 | |
| 478 | |
| 479 | public function test_ลบที่อยู่ลูกค้า(){ |
| 480 | print "test_ลบที่อยู่ลูกค้า\n"; |
| 481 | $aParam = array( |
| 482 | 'FTCstCode' => '00001', |
| 483 | 'FNLngID' => '1', |
| 484 | 'FTAddGrpType' => '1', |
| 485 | 'FNAddSeqNo' => '12', |
| 486 | ); |
| 487 | $oOutput = $this->request( |
| 488 | 'POST', |
| 489 | 'customer/customer/cCustomerAddress/FSoCCSTAddressDeleteEvent', |
| 490 | $aParam |
| 491 | ); |
| 492 | $this->assertStringContainsString('Success Delete Customer Address', $oOutput); |
| 493 | $this->assertResponseCode(200); |
| 494 | } |
| 495 | |
| 496 | |
| 497 | public function test_เข้าหน้าจอแก้ไขที่อยู่ลูกค้า(){ |
| 498 | print "test_เข้าหน้าจอแก้ไขที่อยู่ลูกค้า\n"; |
| 499 | $aParam = array( |
| 500 | 'FTCstCode' => 'b6fdf', |
| 501 | 'FNLngID' => '1', |
| 502 | 'FTAddGrpType' => '1', |
| 503 | 'FNAddSeqNo' => '21', |
| 504 | ); |
| 505 | $oOutput = $this->request( |
| 506 | 'POST', |
| 507 | 'customer/customer/cCustomerAddress/FSvCCSTAddressCallPageEdit', |
| 508 | $aParam |
| 509 | ); |
| 510 | $this->assertStringContainsString('ofmCSTAddressForm', $oOutput); |
| 511 | $this->assertResponseCode(200); |
| 512 | } |
| 513 | |
| 514 | |
| 515 | |
| 516 | |
| 517 | |
| 518 | public function test_CstDebit01_โหลดข้อมูลบัตรเดบิตมาแสดงเป็นตารางต้องสำเร็จ(){ |
| 519 | print "CstDebit01.โหลดข้อมูลบัตรเดบิตมาแสดงเป็นตารางต้องสำเร็จ\n"; |
| 520 | $aParam = array( |
| 521 | 'tCstCode' => 'AR0000100071', |
| 522 | 'tSearchAll' => '', |
| 523 | 'nPageCurrent' => '1', |
| 524 | ); |
| 525 | $oOutput = $this->request( |
| 526 | 'POST', |
| 527 | 'customer/customerDebitCard/cCustomerDebitCard/FSvCCstDebitDataList', |
| 528 | $aParam |
| 529 | ); |
| 530 | $this->assertStringContainsString('obtCompSetConnection', $oOutput); |
| 531 | $this->assertResponseCode(200); |
| 532 | } |
| 533 | |
| 534 | |
| 535 | |
| 536 | public function test_CstDebit02_โหลดข้อมูลบัตรเดบิตมาแสดงเป็นตารางต้องสำเร็จ_Page2(){ |
| 537 | print "CstDebit02.โหลดข้อมูลบัตรเดบิตมาแสดงเป็นตารางต้องสำเร็จ_Page2\n"; |
| 538 | $aParam = array( |
| 539 | 'tCstCode' => 'AR0000100071', |
| 540 | 'tSearchAll' => '', |
| 541 | 'nPageCurrent' => '2', |
| 542 | ); |
| 543 | $oOutput = $this->request( |
| 544 | 'POST', |
| 545 | 'customer/customerDebitCard/cCustomerDebitCard/FSvCCstDebitDataList', |
| 546 | $aParam |
| 547 | ); |
| 548 | $this->assertStringContainsString('obtCompSetConnection', $oOutput); |
| 549 | $this->assertResponseCode(200); |
| 550 | } |
| 551 | |
| 552 | |
| 553 | |
| 554 | public function test_CstDebit03_เข้าหน้าเพิ่มข้อมูลบัตรเดบิต(){ |
| 555 | print "CstDebit03.เข้าหน้าเพิ่มข้อมูลบัตรเดบิต\n"; |
| 556 | $aParam = array( |
| 557 | 'tCstCode' => 'AR0000100071', |
| 558 | ); |
| 559 | $oOutput = $this->request( |
| 560 | 'POST', |
| 561 | 'customer/customerDebitCard/cCustomerDebitCard/FSvCCstDebitPageAdd', |
| 562 | $aParam |
| 563 | ); |
| 564 | $this->assertStringContainsString('ohdTypeCstDebitCardData', $oOutput); |
| 565 | $this->assertResponseCode(200); |
| 566 | } |
| 567 | |
| 568 | |
| 569 | |
| 570 | public function test_CstDebit04_เพิ่มข้อมูลบัตรเดบิตแบบรหัสประเภทบัตรมีตัวอักษรผสมตัวเลข(){ |
| 571 | print "CstDebit04.เพิ่มข้อมูลบัตรเดบิตแบบรหัสประเภทบัตรมีตัวอักษรผสมตัวเลข\n"; |
| 572 | $aParam = array( |
| 573 | 'oetCstCrdCtyCode' => '@TE0001', |
| 574 | 'oetCstCrdCtyName' => 'บัตรTest05012022', |
| 575 | 'oetCstCrdCode' => '100046', |
| 576 | 'oetCstCrdName' => '', |
| 577 | 'ohdCstCode' => 'AR0000100071', |
| 578 | 'ohdValidateDuplicate' => '0', |
| 579 | ); |
| 580 | $oOutput = $this->request( |
| 581 | 'POST', |
| 582 | 'customer/customerDebitCard/cCustomerDebitCard/FSaCCstDebitAddEvent', |
| 583 | $aParam |
| 584 | ); |
| 585 | $this->assertStringContainsString('Success', $oOutput); |
| 586 | $this->assertResponseCode(200); |
| 587 | } |
| 588 | |
| 589 | |
| 590 | |
| 591 | public function test_CstDebit05_เพิ่มข้อมูลบัตรเดบิตแบบรหัสประเภทบัตรเป็นตัวเลข(){ |
| 592 | print "CstDebit05.เพิ่มข้อมูลบัตรเดบิตแบบรหัสประเภทบัตรเป็นตัวเลข\n"; |
| 593 | $aParam = array( |
| 594 | 'oetCstCrdCtyCode' => '00019', |
| 595 | 'oetCstCrdCtyName' => 'บัตร1วัน เติม auto ', |
| 596 | 'oetCstCrdCode' => '100035', |
| 597 | 'oetCstCrdName' => 'บรรลือ', |
| 598 | 'ohdCstCode' => 'AR0000100071', |
| 599 | 'ohdValidateDuplicate' => '0', |
| 600 | ); |
| 601 | $oOutput = $this->request( |
| 602 | 'POST', |
| 603 | 'customer/customerDebitCard/cCustomerDebitCard/FSaCCstDebitAddEvent', |
| 604 | $aParam |
| 605 | ); |
| 606 | $this->assertStringContainsString('Success', $oOutput); |
| 607 | $this->assertResponseCode(200); |
| 608 | } |
| 609 | |
| 610 | |
| 611 | |
| 612 | public function test_CstDebit06_เพิ่มข้อมูลบัตรเดบิตแบบรหัสบัตรซ้ำ(){ |
| 613 | print "CstDebit06.เพิ่มข้อมูลบัตรเดบิตแบบรหัสบัตรซ้ำ\n"; |
| 614 | $aParam = array( |
| 615 | 'oetCstCrdCtyCode' => '@TE0001', |
| 616 | 'oetCstCrdCtyName' => 'บัตรTest05012022', |
| 617 | 'oetCstCrdCode' => '100046', |
| 618 | 'oetCstCrdName' => '', |
| 619 | 'ohdCstCode' => 'AR0000100071', |
| 620 | 'ohdValidateDuplicate' => '0', |
| 621 | ); |
| 622 | $oOutput = $this->request( |
| 623 | 'POST', |
| 624 | 'customer/customerDebitCard/cCustomerDebitCard/FSaCCstDebitAddEvent', |
| 625 | $aParam |
| 626 | ); |
| 627 | $this->assertStringContainsString('Unsucess Add Event', $oOutput); |
| 628 | $this->assertResponseCode(200); |
| 629 | } |
| 630 | |
| 631 | |
| 632 | |
| 633 | public function test_CstDebit07_ลบข้อมูลบัตรเดบิต_C1(){ |
| 634 | print "CstDebit07.ลบข้อมูลบัตรเดบิต_C1\n"; |
| 635 | $aParam = array( |
| 636 | 'tCrdCode' => '100035', |
| 637 | 'tRefCode' => 'AR0000100071', |
| 638 | ); |
| 639 | $oOutput = $this->request( |
| 640 | 'POST', |
| 641 | 'customer/customerDebitCard/cCustomerDebitCard/FSaCCstDebitDeleteEvent', |
| 642 | $aParam |
| 643 | ); |
| 644 | $this->assertStringContainsString('Delete Success.', $oOutput); |
| 645 | $this->assertResponseCode(200); |
| 646 | } |
| 647 | |
| 648 | |
| 649 | |
| 650 | public function test_CstDebit08_ลบข้อมูลบัตรเดบิต_C2(){ |
| 651 | print "CstDebit08.ลบข้อมูลบัตรเดบิต_C2\n"; |
| 652 | $aParam = array( |
| 653 | 'tCrdCode' => '100046', |
| 654 | 'tRefCode' => 'AR0000100071', |
| 655 | ); |
| 656 | $oOutput = $this->request( |
| 657 | 'POST', |
| 658 | 'customer/customerDebitCard/cCustomerDebitCard/FSaCCstDebitDeleteEvent', |
| 659 | $aParam |
| 660 | ); |
| 661 | $this->assertStringContainsString('Delete Success.', $oOutput); |
| 662 | $this->assertResponseCode(200); |
| 663 | } |
| 664 | |
| 665 | |
| 666 | } |