Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 185
0.00% covered (danger)
0.00%
0 / 12
CRAP
0.00% covered (danger)
0.00%
0 / 1
Customerlevel_test
0.00% covered (danger)
0.00%
0 / 185
0.00% covered (danger)
0.00%
0 / 12
272
0.00% covered (danger)
0.00%
0 / 1
 __construct
n/a
0 / 0
n/a
0 / 0
1
 test_เข้าหน้า_index_สำเร็จ
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 1
2
 test_โหลดข้อมูลหน้าจอตัวกรอง
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 1
2
 test_โหลดข้อมูลตารางรายการระดับลูกค้า
0.00% covered (danger)
0.00%
0 / 12
0.00% covered (danger)
0.00%
0 / 1
2
 test_กดหน้าเพิ่มใหม่
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 1
2
 test_เพิ่มข้อมูลแบบระบุชื่อระดับและรหัสอัตโนมัติ_C1
0.00% covered (danger)
0.00%
0 / 26
0.00% covered (danger)
0.00%
0 / 1
2
 test_เพิ่มข้อมูลแบบระบุชื่อระดับและตั้งรหัสระดับเอง_C2
0.00% covered (danger)
0.00%
0 / 26
0.00% covered (danger)
0.00%
0 / 1
2
 test_เพิ่มข้อมูลโดยระบุชื่อระดับและรหัสสร้างเองแบบคีย์และรหัสเคยมีอยู่แล้วต้องได้ผลลัพท์คือการอัพเดทแทนที่_C3
0.00% covered (danger)
0.00%
0 / 30
0.00% covered (danger)
0.00%
0 / 1
6
 test_เข้าหน้าจอแก้ไขแบบมีข้อมูลจริงต้องได้ผลลัพท์สำเร็จ_C1
0.00% covered (danger)
0.00%
0 / 12
0.00% covered (danger)
0.00%
0 / 1
6
 test_อัพเดทข้อมูลระบุชื่อระดับใหม่ไปด้วยความยาวที่ไม่เกินผลลัพท์ต้องสำเร็จ_C1
0.00% covered (danger)
0.00%
0 / 29
0.00% covered (danger)
0.00%
0 / 1
6
 test_ทดสอบลบข้อมูลแบบเดี่ยวส่งข้อมูลไปแบบมีอยู่จริงผลลัพท์ต้องได้สำเร็จ_C1
0.00% covered (danger)
0.00%
0 / 9
0.00% covered (danger)
0.00%
0 / 1
2
 test_FSvRSNDataList_C1
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 1
2
 test_FSvRSNDataList_C2
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3 * Part of ci-phpunit-test
4 *
5 * @author     Kenji Suzuki <https://github.com/kenjis>
6 * @license    MIT License
7 * @copyright  2015 Kenji Suzuki
8 * @link       https://github.com/kenjis/ci-phpunit-test
9 */
10
11class Customerlevel_test extends TestCase
12{
13    // public function setUp(): void {
14    //    echo $this->getName();
15    // }
16    /** 
17    *@codeCoverageIgnore
18    */
19    public function __construct() {
20        parent::__construct();
21        $ci = &get_instance();
22        $ci->load->database();
23        $ci->load->helper('validator_helper');
24        $this->code = substr(md5(uniqid(mt_rand(), true)), 0, 5);
25        $_SESSION =array (
26            '__ci_last_regenerate' => 1674475513,
27            'lang' => 'th',
28            'tLangID' => 1,
29            'tSesUserLogin' => '009',
30            'tSesUsrRoleCodeMulti' => '\'00002\'',
31            'nSesUsrRoleLevel' => 99,
32            'tSesUsrAgnCode' => NULL,
33            'tSesUsrAgnName' => NULL,
34            'tSesUsrMerCode' => NULL,
35            'tSesUsrMerName' => NULL,
36            'tSesUsrBchCodeDefault' => '00001',
37            'tSesUsrBchNameDefault' => 'AdaSoft00001',
38            'tSesUsrBchCodeMulti' => '\'00001\'',
39            'tSesUsrBchNameMulti' => '\'AdaSoft00001\'',
40            'nSesUsrBchCount' => 0,
41            'tSesUsrShpCodeDefault' => '00014',
42            'tSesUsrShpNameDefault' => 'รันไทม์ช็อป',
43            'tSesUsrShpCodeMulti' => '\'00014\'',
44            'tSesUsrShpNameMulti' => '\'รันไทม์ช็อป\'',
45            'nSesUsrShpCount' => 0,
46            'tSesUsrWahCode' => '00001',
47            'tSesUsrWahName' => 'คลังขาย',
48            'tSesUsrLoginLevel' => 'HQ',
49            'tSesUsrLoginAgency' => 0,
50            'bSesLogIn' => 1,
51            'tSesUserCode' => '00002',
52            'tSesUsername' => '00002',
53            'tSesUsrDptName' => NULL,
54            'tSesUsrDptCode' => NULL,
55            'tSesUsrUsername' => 'Adasoft',
56            'tSesUsrImagePerson' => NULL,
57            'tSesUsrInfo' => 
58            array (
59              'FTUsrStaActive' => 1,
60              'FTUsrLogType' => 1,
61              'FTStaError' => 0,
62              'FTUsrCode' => '00002',
63              'FTUsrName' => 'Adasoft',
64              'FTDptCode' => NULL,
65              'FTDptName' => NULL,
66              'FTImgObj' => NULL,
67            ),
68            'tSesUsrGroup' => 
69            array (
70              0 => 
71              array (
72                'FTUsrCode' => '00002',
73                'FTAgnCode' => NULL,
74                'FTAgnName' => NULL,
75                'FTBchCode' => NULL,
76                'FTBchName' => NULL,
77                'FTShpCode' => NULL,
78                'FTShpName' => NULL,
79                'FTMerCode' => NULL,
80                'FTMerName' => NULL,
81                'FTWahCode' => NULL,
82                'FTWahName' => NULL,
83                'FTLoginLevel' => 'HQ',
84                'FTStaLoginAgn' => 0,
85              ),
86            ),
87            'tSesSessionID' => '0000220230123185822',
88            'tSesSessionDate' => '2023-01-23 18:58:22',
89            'tLangEdit' => 1,
90            'bIsHaveAgn' => NULL,
91            'tSesUsrLevel' => 'HQ',
92            '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\'',
93            'bShpEnabled' => 1,
94            'bAgnEnabled' => 1,
95            'bLockerEnabled' => NULL,
96            'bPdtFasionEnabled' => NULL,
97            'tSesHQBchCode' => '00001',
98            'bSesRegStaLicense' => 1,
99            'tSesCstKey' => '52a8a4705e6c',
100            'bSesRegStaBuyPackage' => 1,
101        );
102
103
104    }
105
106
107    // $route ['customerLevel/(:any)/(:any)']          = 'customer/customerLevel/cCustomerLevel/index/$1/$2';
108    // $route ['customerLevelList']                    = 'customer/customerLevel/cCustomerLevel/FSvCstLevListPage';
109    // $route ['customerLevelDataTable']               = 'customer/customerLevel/cCustomerLevel/FSvCstLevDataList';
110    // $route ['customerLevelPageAdd']                 = 'customer/customerLevel/cCustomerLevel/FSvCstLevAddPage';
111    // $route ['customerLevelEventAdd']                = 'customer/customerLevel/cCustomerLevel/FSaCstLevAddEvent';
112    // $route ['customerLevelPageEdit']                = 'customer/customerLevel/cCustomerLevel/FSvCstLevEditPage';
113    // $route ['customerLevelEventEdit']               = 'customer/customerLevel/cCustomerLevel/FSaCstLevEditEvent';
114    // $route ['customerLevelDeleteMulti']             = 'customer/customerLevel/cCustomerLevel/FSoCstLevDeleteMulti';
115    // $route ['customerLevelDelete']                  = 'customer/customerLevel/cCustomerLevel/FSoCstLevDelete';
116    // $route ['customerLevelUniqueValidate/(:any)']   = 'customer/customerLevel/cCustomerLevel/FStCstLevUniqueValidate/$1';
117//     //1.เข้าหน้า index สำเร็จ
118    //ทดสอบเข้าหน้ามาสเตอร์
119    public function test_เข้าหน้า_index_สำเร็จ(){
120        print " 1.เข้าหน้า index สำเร็จ\n";
121        $oOutput = $this->request(
122            'POST',
123            'customer/customerLevel/cCustomerLevel/index/0/0'
124        );
125        $this->assertStringContainsString('oetCstLevStaBrowse', $oOutput);
126        $this->assertResponseCode(200);
127    }
128
129    //2.เข้าหน้า list สำเร็จ
130    //ทดสอบเข้าหน้า List
131    public function test_โหลดข้อมูลหน้าจอตัวกรอง(){
132        print " 2.เข้าหน้า list สำเร็จ\n";
133        $oOutput = $this->request(
134            'POST',
135            'customer/customerLevel/cCustomerLevel/FSvCstLevListPage'
136        );
137        $this->assertStringContainsString('oimSearchCstLev', $oOutput);
138        $this->assertResponseCode(200);
139    }
140
141    //3.เข้าหน้า list สำเร็จ
142    //ทดสอบเข้าหน้า List
143    public function test_โหลดข้อมูลตารางรายการระดับลูกค้า(){
144        print " 3.เข้าหน้า list สำเร็จ\n";
145        $aParam = array(
146            'tSearchAll' => '',
147            'nPageCurrent' => '1',
148          );
149        $oOutput = $this->request(
150            'POST',
151            'customer/customerLevel/cCustomerLevel/FSvCstLevDataList',
152            $aParam
153        );
154        $this->assertStringContainsString('otdCstLevName', $oOutput);
155        $this->assertResponseCode(200);
156    }
157
158    //3.เข้าหน้า Add สำเร็จ
159    //ทดสอบเข้าหน้าเพิ่มข้อมูล
160    public function test_กดหน้าเพิ่มใหม่(){
161        print " 4.เข้าหน้า Add สำเร็จ\n";
162        $oOutput = $this->request(
163            'POST',
164            'customer/customerLevel/cCustomerLevel/FSvCstLevAddPage'
165        );
166        $this->assertStringContainsString('odvCstLevCodeForm', $oOutput);
167        $this->assertResponseCode(200);
168    }
169
170    //4.เพิ่มข้อมูล โดยระบุชื่อระดับ และ รหัสสร้างอัตโนมัติ ต้องได้ผลลัพท์คือเพิ่มได้สำเร็จ
171    //สร้างแบบปกติ ระบุเพียงชื่อชื่อระดับอย่างเดียว และ สร้างรหัสอัตโนมัติ
172    public function test_เพิ่มข้อมูลแบบระบุชื่อระดับและรหัสอัตโนมัติ_C1(){
173        print " 5.เพิ่มข้อมูล โดยระบุชื่อระดับ และ รหัสสร้างอัตโนมัติ ต้องได้ผลลัพท์คือเพิ่มได้สำเร็จ\n";
174        $aParam = array(
175            'ohdLngIdLocal' => '4',
176            'ocbCustomerLevelAutoGenCode' => '1',
177            'ohdCheckDuplicateCstLevCode' => '1',
178            'ohdTypeCode' => '1',
179            'oetCstLevAgnCode' => '',
180            'oetCstLevAgnName' => '',
181            'ocmMemberTypes' => '1',
182            'ocmCstShpType' => '1',
183            'oetCstLevPplCode' => '00010',
184            'oetCstLevPplName' => 'กลุ่มราคาสินค้า01ไทย',
185            'oetCstLevName' => 'test',
186            'otaCstLevRemark' => '',
187            'oetCstLevName1' => 'ทดสอบ',
188            'otaCstLevRemark1' => '',
189            'oetCstLevName2' => '',
190            'otaCstLevRemark2' => '',
191            'oetCstLevName5' => '',
192            'otaCstLevRemark5' => '',
193          );
194        $oOutput = $this->ajaxRequest('POST', 'customer/customerLevel/cCustomerLevel/FSaCstLevAddEvent',$aParam);
195        $this->assertStringContainsString(
196            'Success Add Event', $oOutput
197        );
198        $this->assertResponseCode(200);
199        
200    }
201
202    //5.เพิ่มข้อมูล โดยระบุชื่อระดับ และ รหัสสร้างเองแบบคีย์ ต้องได้ผลลัพท์คือเพิ่มได้สำเร็จ
203    //สร้างแบบ รหัสแบบกรอกเองแบบไม่ซ้ำ และ ระบุชื่อเพียงอย่างเดียว
204    public function test_เพิ่มข้อมูลแบบระบุชื่อระดับและตั้งรหัสระดับเอง_C2(){
205        print " 6.เพิ่มข้อมูล โดยระบุชื่อระดับ และ รหัสสร้างเองแบบคีย์ ต้องได้ผลลัพท์คือเพิ่มได้สำเร็จ\n";
206        $aParam = array(
207            'ohdLngIdLocal' => '4',
208            'ohdCheckDuplicateCstLevCode' => '2',
209            'oetCstLevCode' => 'NH001',
210            'ohdTypeCode' => '1',
211            'oetCstLevAgnCode' => '',
212            'oetCstLevAgnName' => '',
213            'ocmMemberTypes' => '1',
214            'ocmCstShpType' => '1',
215            'oetCstLevPplCode' => '',
216            'oetCstLevPplName' => '',
217            'oetCstLevName' => 'test',
218            'otaCstLevRemark' => '',
219            'oetCstLevName1' => 'test',
220            'otaCstLevRemark1' => '',
221            'oetCstLevName2' => '',
222            'otaCstLevRemark2' => '',
223            'oetCstLevName5' => '',
224            'otaCstLevRemark5' => '',
225          );
226        $oOutput = $this->ajaxRequest('POST', 'customer/customerLevel/cCustomerLevel/FSaCstLevAddEvent',$aParam);
227        $this->assertStringContainsString(
228            'Success Add Event', $oOutput
229        );
230        $this->assertResponseCode(200);
231        
232    }
233
234        //6.เพิ่มข้อมูล โดยระบุชื่อระดับ และ รหัสสร้างเองแบบคีย์ และ รหัสเคยมีอยู่แล้ว ต้องได้ผลลัพท์คือการอัพเดทแทนที่
235        //สร้างแบบ รหัสแบบกรอกเองแบบซ้ำ และ ระบุชื่อเพียงอย่างเดียว
236        public function test_เพิ่มข้อมูลโดยระบุชื่อระดับและรหัสสร้างเองแบบคีย์และรหัสเคยมีอยู่แล้วต้องได้ผลลัพท์คือการอัพเดทแทนที่_C3(){
237            print " 7.เพิ่มข้อมูล โดยระบุชื่อระดับ และ รหัสสร้างเองแบบคีย์ และ รหัสเคยมีอยู่แล้ว ต้องได้ผลลัพท์คือการอัพเดทแทนที่\n";
238            $ci = &get_instance();
239            $ci->load->database();
240            $aResult = $ci->db->select(['FTClvCode','FTClvName'])->where('FNLngID',1)->where('FTClvCode!=','')->limit(1)->get('TCNMCstLev_L')->row_array();
241            if(!empty($aResult)){
242                $aParam = array(
243                    'ohdLngIdLocal' => '4',
244                    'ohdCheckDuplicateCstLevCode' => '2',
245                    'oetCstLevCode' => $aResult['FTClvCode'],
246                    'ohdTypeCode' => '1',
247                    'oetCstLevAgnCode' => '',
248                    'oetCstLevAgnName' => '',
249                    'ocmMemberTypes' => '1',
250                    'ocmCstShpType' => '1',
251                    'oetCstLevPplCode' => '',
252                    'oetCstLevPplName' => '',
253                    'oetCstLevName' => $aResult['FTClvName'],
254                    'otaCstLevRemark' => '',
255                    'oetCstLevName1' => $aResult['FTClvName'],
256                    'otaCstLevRemark1' => '',
257                    'oetCstLevName2' => '',
258                    'otaCstLevRemark2' => '',
259                    'oetCstLevName5' => '',
260                    'otaCstLevRemark5' => '',
261                  );
262            }
263            $oOutput = $this->ajaxRequest('POST', 'customer/customerLevel/cCustomerLevel/FSaCstLevAddEvent',$aParam);
264            $this->assertStringContainsString(
265                'Data Code Duplicate', $oOutput
266            );
267            $this->assertResponseCode(200);
268            
269        }
270
271
272    // //7.เข้าหน้าจอแก้ไขแบบมีข้อมูลจริง  ต้องได้ผลลัพท์สำเร็จ
273    // //ทดสอบเข้าหน้าแก้ไข แบบปกติ
274    public function test_เข้าหน้าจอแก้ไขแบบมีข้อมูลจริงต้องได้ผลลัพท์สำเร็จ_C1(){
275        print " 8.เข้าหน้าจอแก้ไขแบบมีข้อมูลจริง  ต้องได้ผลลัพท์สำเร็จ\n";
276        $ci = &get_instance();
277        $ci->load->database();
278        $aResult = $ci->db->select(['FTClvCode','FTClvName'])->where('FNLngID',1)->where('FTClvCode!=','')->limit(1)->get('TCNMCstLev_L')->row_array();
279        if(!empty($aResult)){
280            $oOutput = $this->request(
281                'POST',
282                'customer/customerLevel/cCustomerLevel/FSvCstLevEditPage',
283                ['tCstLevCode'=>$aResult['FTClvCode']]
284            );
285
286        }
287
288        $this->assertStringContainsString('odvCstLevCodeForm', $oOutput);
289        $this->assertResponseCode(200);
290    }
291
292
293    //9.อัพเดทข้อมูล ระบุชื่อชื่อระดับใหม่ไปด้วยความยาวที่ไม่เกิน ผลลัพท์ต้องสำเร็จ
294    //แก้ไขข้อมูล แก้ชื่อใหม่
295    public function test_อัพเดทข้อมูลระบุชื่อระดับใหม่ไปด้วยความยาวที่ไม่เกินผลลัพท์ต้องสำเร็จ_C1(){
296        print " 9.อัพเดทข้อมูล ระบุชื่อชื่อระดับใหม่ไปด้วยความยาวที่ไม่เกิน ผลลัพท์ต้องสำเร็จ\n";
297        $ci = &get_instance();
298        $ci->load->database();
299        $aResult = $ci->db->select(['FTClvCode','FTClvName'])->where('FNLngID',1)->where('FTClvCode!=','')->limit(1)->get('TCNMCstLev_L')->row_array();
300        if(!empty($aResult)){
301            $aParam = array(
302                'ohdLngIdLocal' => '4',
303                'ohdCheckDuplicateCstLevCode' => '1',
304                'oetCstLevCode' => $aResult['FTClvCode'],
305                'ohdTypeCode' => '1',
306                'oetCstLevAgnCode' => '',
307                'oetCstLevAgnName' => '',
308                'ocmCstShpType' => '1',
309                'oetCstLevPplCode' => '',
310                'oetCstLevPplName' => '',
311                'oetCstLevName' => $aResult['FTClvName'],
312                'otaCstLevRemark' => '',
313                'oetCstLevName1' => $aResult['FTClvName'],
314                'otaCstLevRemark1' => '',
315                'oetCstLevName2' => '',
316                'otaCstLevRemark2' => '',
317                'oetCstLevName5' => '',
318                'otaCstLevRemark5' => '',
319              );
320        }
321        $oOutput = $this->ajaxRequest('POST', 'customer/customerLevel/cCustomerLevel/FSaCstLevEditEvent',$aParam);
322        $this->assertStringContainsString(
323            'Success Add Event', $oOutput
324        );
325        $this->assertResponseCode(200);
326        
327    }
328
329        //10. ทดสอบลบข้อมูลแบบเดี่ยว ส่งข้อมูลไปแบบมีอยู่จริง ผลลัพท์ต้องได้สำเร็จ
330        //ลบข้อมูลแบบปกติ Sigle
331        public function test_ทดสอบลบข้อมูลแบบเดี่ยวส่งข้อมูลไปแบบมีอยู่จริงผลลัพท์ต้องได้สำเร็จ_C1(){
332            print " 10.ทดสอบลบข้อมูลแบบเดี่ยว ส่งข้อมูลไปแบบมีอยู่จริง ผลลัพท์ต้องได้สำเร็จ\n";
333            $aParam = array(
334                'tIDCode'   => $this->code,
335            );
336            $oOutput = $this->ajaxRequest('POST', 'customer/customerLevel/cCustomerLevel/FSaCstLevDeleteEvent',$aParam);
337            $this->assertStringContainsString(
338                'success', $oOutput
339            );
340            $this->assertResponseCode(200);
341        
342        }
343
344        //11.ทดสอบค้นหาข้อมูลจากหน้าจอ
345        public function test_FSvRSNDataList_C1(){
346            print " 11.ทดสอบค้นหาข้อมูลจากหน้าจอ ต้องสำเร็จ\n";
347            $aParam = array(
348                'nPageCurrent'   => 1,
349                'tSearchAll'   => 'HN001'
350            );
351            $oOutput = $this->ajaxRequest('POST', 'customer/customerLevel/cCustomerLevel/FSvCstLevDataList',$aParam);
352            $this->assertStringContainsString(
353                'odvRGPList', $oOutput
354            );
355            $this->assertResponseCode(200);
356        
357        }
358
359
360
361        //12.ทดสอบกดหน้าถัดไป
362        public function test_FSvRSNDataList_C2(){
363            print " 12.ทดสอบกดหน้าถัดไป\n";
364            $aParam = array(
365                'nPageCurrent'   => 2,
366                'tSearchAll'   => ''
367            );
368            $oOutput = $this->ajaxRequest('POST', 'customer/customerLevel/cCustomerLevel/FSvCstLevDataList',$aParam);
369            $this->assertStringContainsString(
370                'odvRGPList', $oOutput
371            );
372            $this->assertResponseCode(200);
373        
374        }
375        
376
377
378
379    // //13.อัพเดทข้อมูล ระบุชื่อชื่อระดับใหม่ไปด้วยความยาวที่ไม่เกิน ผลลัพท์ต้องสำเร็จ
380    // //แก้ไขข้อมูล แก้ชื่อใหม่
381    // public function test_FSaRSNEditEvent_C4(){
382    //     print ' 13.เพิ่มข้อมูลแบบรหัสอัตโนมัติและมีชื่อที่นาวเกินขนาดฟิว';
383    //     $aParam = array(
384    //         'ocbReasonAutoGenCode'   => '1',
385    //         'oetRsnCode'=> '',
386    //         'ocmRcnGroup' => '001',
387    //         'oetRsnName'  => 'ทดสอบใหม่ ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่ทดสอบใหม่',
388    //         'oetRsnRemark'  => '',
389    //         'oetRSNAgnCode'  => ''
390    //     );
391    //     //validator
392    //     $afield = [
393    //         'ocbReasonAutoGenCode' => 'max:1',
394    //         'oetRsnCode' => 'required,max:5',
395    //         'ocmRcnGroup' => 'required,max:5',
396    //         'oetRsnName' => 'max:200',
397    //         'oetRsnRemark' => 'max:100',
398    //         'oetRSNAgnCode' => 'max:10',
399    //     ];
400    //    $aResult = json_encode(validate($aParam,$afield));
401    //     $this->assertStringContainsString('The oetRsnName must have at most 200 characters', $aResult);
402    
403    // }
404
405    // //13.อัพเดทข้อมูล ระบุชื่อชื่อระดับใหม่ไปด้วยความยาวที่ไม่เกิน ผลลัพท์ต้องสำเร็จ
406    // //แก้ไขข้อมูล แก้ชื่อใหม่
407    // public function test_FSaRSNEditEvent_C5(){
408    //     print ' 14.เพิ่มข้อมูลแบบผิดประเภทของฟิวด์';
409    //     $aParam = array(
410    //         'ocbReasonAutoGenCode'   => '1',
411    //         'oetRsnCode'=> '',
412    //         'ocmRcnGroup' => '001',
413    //         'oetRsnName'  => array('testfailr'),
414    //         'oetRsnRemark'  => '',
415    //         'oetRSNAgnCode'  => ''
416    //     );
417    //     $afield = array(
418    //         'ocbReasonAutoGenCode'   => 'string',
419    //         'oetRsnCode'=> 'string',
420    //         'ocmRcnGroup' => 'string',
421    //         'oetRsnName'  => 'string',
422    //         'oetRsnRemark'  => 'string',
423    //         'oetRSNAgnCode'  => 'string'
424    //     );
425    //     // print gettype($aParam['oetRsnName']);
426        
427    //     $aResult = json_encode(validate_type($aParam,$afield));
428    //     $this->assertStringContainsString('Error type varible ', $aResult);
429        
430    // }
431
432
433
434
435}