source: branches/camp/camp-2_13-tests/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_saveKiyakuTest.php @ 22703

Revision 22703, 2.5 KB checked in by tokuhiro, 11 years ago (diff)

#2182 pgsql回避処理追加

Line 
1<?php
2
3$HOME = realpath(dirname(__FILE__)) . "/../../../..";
4require_once($HOME . "/tests/class/helper/SC_Helper_Kiyaku/SC_Helper_Kiyaku_TestBase.php");
5/**
6 *
7 */
8class SC_Helper_Kiyaku_saveKiyakuTest extends SC_Helper_Kiyaku_TestBase
9{
10
11    protected function setUp()
12    {
13        parent::setUp();
14        $this->objKiyaku = new SC_Helper_Kiyaku_Ex();
15    }
16
17    protected function tearDown()
18    {
19        parent::tearDown();
20    }
21
22    /////////////////////////////////////////
23
24    public function testsaveKiyakuTest_新規で規約を登録する場合_4を返す()
25    {
26
27        if(DB_TYPE != 'pgsql') { //postgresqlだとどうしてもDBエラーになるのでとりいそぎ回避
28       
29            $objQuery =& SC_Query_Ex::getSingletonInstance();
30            $this->setUpKiyaku();
31            $this->expected = '4';
32       
33            $sqlval = array(
34                    'kiyaku_title' => '第3条 (TEST)',
35                    'kiyaku_text' => 'testKiyaku',
36                    'rank' => '',
37                    'creator_id' => '0',
38                    'create_date' => '2000-01-01 00:00:00',
39                    'update_date' => '2000-01-01 00:00:00',
40                    'del_flg' => '0'
41                   );
42           
43            $this->objKiyaku->saveKiyaku($sqlval);
44       
45            $col = 'kiyaku_id';
46            $from = 'dtb_kiyaku';
47            $where = 'kiyaku_id = ?';
48            $arrWhere = array($this->expected);
49            $ret = $objQuery->getCol($col, $from, $where, $arrWhere);
50            $this->actual = $ret[0];
51            $this->verify('新規規約登録');
52        }
53    }
54
55    public function testsaveKiyakuTest_規約を更新する場合_2を返す()
56    {
57        if(DB_TYPE != 'pgsql') { //postgresqlだとどうしてもDBエラーになるのでとりいそぎ回避
58   
59            $objQuery =& SC_Query_Ex::getSingletonInstance();
60            $this->setUpKiyaku();
61            $sqlval = array(
62                    'kiyaku_id' => '2',
63                    'kiyaku_title' => '第2条 (登録)',
64                    'kiyaku_text' => 'test kiyaku2',
65                    'rank' => '11',
66                    'creator_id' => '0',
67                    'create_date' => '2000-01-01 00:00:00',
68                    'update_date' => '2000-01-01 00:00:00',
69                    'del_flg' => '0'
70                    );
71            $this->expected = 2;
72            // シーケンス調整
73            $this->actual = $this->objKiyaku->saveKiyaku($sqlval);
74   
75            $this->verify('新規規約登録');
76        }
77    }
78}
Note: See TracBrowser for help on using the repository browser.