source: branches/version-2_12-dev/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_unsetAllShippingTempTest.php @ 22128

Revision 22128, 1.4 KB checked in by shift_hiroko.tamagawa, 9 years ago (diff)

単体テスト用基盤クラスと一部テストコードを追加

RevLine 
[22128]1<?php
2
3$HOME = realpath(dirname(__FILE__)) . "/../../../..";
4require_once($HOME . "/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_BaseTest.php");
5/**
6 *
7 */
8class SC_Helper_Purchase_unsetAllShippingTempTest extends SC_Helper_Purchase_BaseTest {
9
10  protected function setUp() {
11    parent::setUp();
12
13    // 空にするだけなので適当な値を設定
14    $_SESSION['shipping'] = 'temp01';
15    $_SESSION['multiple_temp'] = 'temp02';
16  }
17
18  protected function tearDown() {
19    parent::tearDown();
20  }
21
22  /////////////////////////////////////////
23  public function testUnsetAllShippingTemp_複数配送も破棄するフラグがOFFの場合_情報の一部が破棄される() {
24    SC_Helper_Purchase::unsetAllShippingTemp();
25
26    $this->expected = array('shipping'=>TRUE, 'multiple_temp'=>FALSE);
27    $this->actual['shipping'] = empty($_SESSION['shipping']);
28    $this->actual['multiple_temp'] = empty($_SESSION['multiple_temp']);
29
30    $this->verify('セッション情報が空かどうか');
31  }
32
33  public function testUnsetAllShippingTemp_複数配送も破棄するフラグがONの場合_全ての情報が破棄される() {
34    SC_Helper_Purchase::unsetAllShippingTemp(TRUE);
35
36    $this->expected = array('shipping'=>TRUE, 'multiple_temp'=>TRUE);
37    $this->actual['shipping'] = empty($_SESSION['shipping']);
38    $this->actual['multiple_temp'] = empty($_SESSION['multiple_temp']);
39
40    $this->verify('セッション情報が空かどうか');
41  }
42
43}
44
Note: See TracBrowser for help on using the repository browser.