source: branches/version-2_13-dev/tests/class/helper/SC_Helper_Address/SC_Helper_Address_registAddressTest.php @ 22856

Revision 22856, 3.7 KB checked in by Seasoft, 11 years ago (diff)

#2043 (typo修正・ソース整形・ソースコメントの改善 for 2.13.0)

  • 主に空白・空白行の調整。もう少し整えたいが、一旦現状コミット。
Line 
1<?php
2
3$HOME = realpath(dirname(__FILE__)) . "/../../../..";
4require_once($HOME . "/tests/class/helper/SC_Helper_Address/SC_Helper_Address_TestBase.php");
5/**
6 *
7 */
8class SC_Helper_Address_registAddressTest extends SC_Helper_Address_TestBase
9{
10
11    protected function setUp()
12    {
13        parent::setUp();
14        $this->objAddress = new SC_Helper_Address_Ex();
15    }
16
17    protected function tearUp()
18    {
19        parent::tearUp();
20    }
21
22    /////////////////////////////////////////
23
24//顧客idがない場合は直にExitしてしまうので未実行
25/*
26    public function testregistAddressTest_顧客idが無い場合_システムエラーを返す()
27    {
28        $objQuery =& SC_Query_Ex::getSingletonInstance();
29        $this->setUpAddress();
30        //$this->expected = "1";
31        $this->objAddress->registAddress(null);
32        $this->actual = '';
33        $this->verify('アドレス追加');
34    }
35*/
36
37
38    /* MySQL でもエラーになるのでとりいそぎ回避
39    public function testregistAddressTest_会員の登録配送先を追加する()
40    {
41         if(DB_TYPE != 'pgsql') { //postgresqlだとどうしてもDBエラーになるのでとりいそぎ回避
42            $this->setUpAddress();
43            $arrSql =
44                array(
45                    'customer_id' => '1',
46                    'name01' => 'テスト',
47                    'name02' => 'よん',
48                    'kana01' => 'テスト',
49                    'kana02' => 'ヨン',
50                    'zip01' => '333',
51                    'zip02'=> '3333',
52                    'pref' => '4',
53                    'addr01' => 'テスト4',
54                    'addr02' => 'テスト4',
55                    'tel01' => '001',
56                    'tel02' => '0002',
57                    'tel03' => '0003',
58                    'fax01' => '112',
59                    'fax02' => '1113',
60                    'fax03' => '1114',
61                    'country_id' => null
62                );
63            $objQuery =& SC_Query_Ex::getSingletonInstance();
64            $this->expected = '1002';
65            $this->objAddress->registAddress($arrSql);
66            $col = 'other_deliv_id';
67            $from = 'dtb_other_deliv';
68            $where = 'other_deliv_id = ?';
69            $arrWhere = array($this->expected);
70            $ret = $objQuery->select($col, $from, $where, $arrWhere);
71            $this->actual = $ret['other_deliv_id'];
72            $this->verify('アドレス追加');
73        }
74    }
75    */
76
77
78    public function testregistAddressTest_会員の登録配送先を更新する()
79    {
80        $this->setUpAddress();
81        $arrSql =
82            array(
83                'other_deliv_id' => '1000',
84                'customer_id' => '1',
85                'name01' => 'テスト',
86                'name02' => '更新',
87                'kana01' => 'テスト',
88                'kana02' => 'コウシン',
89                'zip01' => '222',
90                'zip02'=> '2222',
91                'pref' => '4',
92                'addr01' => 'テスト1',
93                'addr02' => 'テスト1',
94                'tel01' => '001',
95                'tel02' => '0002',
96                'tel03' => '0003',
97                'fax01' => '112',
98                'fax02' => '1113',
99                'fax03' => '1114',
100                'country_id' => null
101            );
102        $objQuery =& SC_Query_Ex::getSingletonInstance();
103        $this->objAddress->registAddress($arrSql);
104
105        $this->expected = $arrSql;
106        $col = '*';
107        $from = 'dtb_other_deliv';
108        $where = 'other_deliv_id = ?';
109        $arrWhere = array($arrSql['other_deliv_id']);
110        $this->actual = $objQuery->getRow($col, $from, $where, $arrWhere);
111       
112        $this->verify('登録配送先更新');
113    }
114
115}
Note: See TracBrowser for help on using the repository browser.