Index: /branches/version-2_12-dev/tests/class/SC_SiteSession/SC_SiteSession_isPrepageTest.php
===================================================================
--- /branches/version-2_12-dev/tests/class/SC_SiteSession/SC_SiteSession_isPrepageTest.php	(revision 22195)
+++ /branches/version-2_12-dev/tests/class/SC_SiteSession/SC_SiteSession_isPrepageTest.php	(revision 22195)
@@ -0,0 +1,68 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+$HOME = realpath(dirname(__FILE__)) . "/../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+
+class SC_Session_isPrepageTest extends Common_TestCase {
+
+    protected function setUp() {
+        parent::setUp();
+        $this->objSiteSession = new SC_SiteSession_Ex();
+    }
+
+    protected function tearDown() {
+        parent::tearDown();
+    }
+
+    /////////////////////////////////////////
+
+    public function testIsPrepage_sessionが空の場合_false() {
+        $this->expected = false;
+        $this->actual = $this->objSiteSession->isPrepage();
+        $this->verify("ページ判定");
+    }
+    
+    public function testIsPrepage_prepageとnowpageが違う場合_false() {
+        $this->expected = false;
+        $_SESSION['site']['pre_page'] = 'test.php';
+        $this->actual = $this->objSiteSession->isPrepage();
+        $this->verify("ページ判定");
+    }
+    
+    public function testIsPrepage_prepageとnowpageが同じの場合_true() {
+        $this->expected = true;
+        $_SESSION['site']['pre_page'] = $_SERVER['SCRIPT_NAME'];
+        $this->actual = $this->objSiteSession->isPrepage();
+        $this->verify("ページ判定");
+    }
+    
+    public function testIsPrepage_pre_regist_successがtrueの場合_true() {
+        $this->expected = true;
+        $_SESSION['site']['pre_page'] = 'test.php';
+        $_SESSION['site']['pre_regist_success'] = true;
+        $this->actual = $this->objSiteSession->isPrepage();
+        $this->verify("ページ判定");
+    }
+}
+
Index: /branches/version-2_12-dev/tests/class/SC_SiteSession/SC_SiteSession_setRegistFlagTest.php
===================================================================
--- /branches/version-2_12-dev/tests/class/SC_SiteSession/SC_SiteSession_setRegistFlagTest.php	(revision 22195)
+++ /branches/version-2_12-dev/tests/class/SC_SiteSession/SC_SiteSession_setRegistFlagTest.php	(revision 22195)
@@ -0,0 +1,44 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+$HOME = realpath(dirname(__FILE__)) . "/../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+
+class SC_Session_setRegistFlagTest extends Common_TestCase {
+
+    protected function setUp() {
+        parent::setUp();
+        $this->objSiteSession = new SC_SiteSession_Ex();
+    }
+
+    protected function tearDown() {
+        parent::tearDown();
+    }
+
+    /////////////////////////////////////////
+
+    public function testSetRegistFlag_TRUEがセットされる() {
+        $this->objSiteSession->setRegistFlag();
+        $this->assertTrue($_SESSION['site']['regist_success'],'登録成功フラグ');
+    }
+}
Index: /branches/version-2_12-dev/tests/class/SC_SiteSession/SC_SiteSession_setUniqIdTest.php
===================================================================
--- /branches/version-2_12-dev/tests/class/SC_SiteSession/SC_SiteSession_setUniqIdTest.php	(revision 22195)
+++ /branches/version-2_12-dev/tests/class/SC_SiteSession/SC_SiteSession_setUniqIdTest.php	(revision 22195)
@@ -0,0 +1,44 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+$HOME = realpath(dirname(__FILE__)) . "/../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+
+class SC_Session_setUniqIdTest extends Common_TestCase {
+
+    protected function setUp() {
+        parent::setUp();
+        $this->objSiteSession = new SC_SiteSession_Ex();
+    }
+
+    protected function tearDown() {
+        parent::tearDown();
+    }
+
+    /////////////////////////////////////////
+
+    public function testSetUniqId_ユニークなID設定する() {
+        $this->objSiteSession->setUniqId();
+        $this->assertNotEmpty($_SESSION['site']['uniqid'], 'ユニークID');
+    }
+}
Index: /branches/version-2_12-dev/tests/class/SC_SiteSession/SC_SiteSession_checkUniqIdTest.php
===================================================================
--- /branches/version-2_12-dev/tests/class/SC_SiteSession/SC_SiteSession_checkUniqIdTest.php	(revision 22195)
+++ /branches/version-2_12-dev/tests/class/SC_SiteSession/SC_SiteSession_checkUniqIdTest.php	(revision 22195)
@@ -0,0 +1,65 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+$HOME = realpath(dirname(__FILE__)) . "/../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+
+class SC_Session_checkUniqIdTest extends Common_TestCase {
+
+    protected function setUp() {
+        parent::setUp();
+        $this->objSiteSession = new SC_SiteSession_Ex();
+    }
+
+    protected function tearDown() {
+        parent::tearDown();
+    }
+
+    /////////////////////////////////////////
+
+    public function testCheckUniqId_POST値がない場合_True() {
+        $_POST = null;
+        $this->expected = true;
+        $this->actual = $this->objSiteSession->checkUniqId();
+        $this->verify('ポスト値空');
+    }
+    
+    public function testCheckUniqId_POSTとセッションのUniqIDが一致する場合_True() {
+        $_POST['uniqid'] = '1234567890';
+        $_SESSION['site']['uniqid'] = '1234567890';
+        
+        $this->expected = true;
+        $this->actual = $this->objSiteSession->checkUniqId();
+        $this->verify('ユニークID一致');
+    }
+    
+    public function testCheckUniqId_POSTとセッションのUniqIDが一致しない場合_False() {
+        $_POST['uniqid'] = '0987654321';
+        $_SESSION['site']['uniqid'] = '1234567890';
+        
+        $this->expected = false;
+        $this->actual = $this->objSiteSession->checkUniqId();
+        $this->verify('ユニークID不一致');
+    }
+
+}
Index: /branches/version-2_12-dev/tests/class/SC_SiteSession/SC_SiteSession_unsetUniqIdTest.php
===================================================================
--- /branches/version-2_12-dev/tests/class/SC_SiteSession/SC_SiteSession_unsetUniqIdTest.php	(revision 22195)
+++ /branches/version-2_12-dev/tests/class/SC_SiteSession/SC_SiteSession_unsetUniqIdTest.php	(revision 22195)
@@ -0,0 +1,45 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+$HOME = realpath(dirname(__FILE__)) . "/../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+
+class SC_Session_unsetUniqIdTest extends Common_TestCase {
+
+    protected function setUp() {
+        parent::setUp();
+        $this->objSiteSession = new SC_SiteSession_Ex();
+    }
+
+    protected function tearDown() {
+        parent::tearDown();
+    }
+
+    /////////////////////////////////////////
+
+    public function testUnsetUniqId_uniqIDを解除する() {
+        $_SESSION['site']['uniqid'] = '1234567890';
+        $this->objSiteSession->unsetUniqId();
+        $this->assertEmpty($_SESSION['site']['uniqid'], '空のユニークID');
+    }
+}
Index: /branches/version-2_12-dev/tests/class/SC_SiteSession/SC_SiteSession_getUniqIdTest.php
===================================================================
--- /branches/version-2_12-dev/tests/class/SC_SiteSession/SC_SiteSession_getUniqIdTest.php	(revision 22195)
+++ /branches/version-2_12-dev/tests/class/SC_SiteSession/SC_SiteSession_getUniqIdTest.php	(revision 22195)
@@ -0,0 +1,59 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+$HOME = realpath(dirname(__FILE__)) . "/../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+
+class SC_Session_getUniqIdTest extends Common_TestCase {
+
+    protected function setUp() {
+        parent::setUp();
+        $this->objSiteSession = new SC_SiteSession_Mock();
+    }
+
+    protected function tearDown() {
+        parent::tearDown();
+    }
+
+    /////////////////////////////////////////
+
+    public function testGetUniqId_設定済みのユニークなID取得する() {
+        $_SESSION['site']['uniqid'] = '0987654321';
+        $this->expected = '0987654321';
+        $this->actual = $this->objSiteSession->getUniqId();
+        $this->verify('ユニークID');
+    }
+    
+    public function testGetUniqId_新たにユニークなID取得する() {
+        $_SESSION['site']['uniqid'] = '';
+        $this->expected = '1234567890';
+        $this->actual = $this->objSiteSession->getUniqId();
+        $this->verify('ユニークID');
+    }
+}
+
+class SC_SiteSession_Mock extends SC_SiteSession_Ex {
+    function setUniqId() {
+        $_SESSION['site']['uniqid'] = '1234567890';
+    }
+}
Index: /branches/version-2_12-dev/tests/class/SC_SiteSession/SC_SiteSession_getValueTest.php
===================================================================
--- /branches/version-2_12-dev/tests/class/SC_SiteSession/SC_SiteSession_getValueTest.php	(revision 22195)
+++ /branches/version-2_12-dev/tests/class/SC_SiteSession/SC_SiteSession_getValueTest.php	(revision 22195)
@@ -0,0 +1,46 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+$HOME = realpath(dirname(__FILE__)) . "/../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+
+class SC_Session_getValueTest extends Common_TestCase {
+
+    protected function setUp() {
+        parent::setUp();
+        $this->objSiteSession = new SC_SiteSession_Ex();
+    }
+
+    protected function tearDown() {
+        parent::tearDown();
+    }
+
+    /////////////////////////////////////////
+
+    public function testSetNowPage_セッションの値を取得する() {
+        $this->expected = $_SERVER['SCRIPT_NAME'];
+        $this->actual = $this->objSiteSession->getValue('now_page');
+        $this->verify("セッション値");
+    }
+}
+
Index: /branches/version-2_12-dev/tests/class/SC_SiteSession/SC_SiteSession_setNowPageTest.php
===================================================================
--- /branches/version-2_12-dev/tests/class/SC_SiteSession/SC_SiteSession_setNowPageTest.php	(revision 22195)
+++ /branches/version-2_12-dev/tests/class/SC_SiteSession/SC_SiteSession_setNowPageTest.php	(revision 22195)
@@ -0,0 +1,47 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+$HOME = realpath(dirname(__FILE__)) . "/../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+
+class SC_Session_setNowPageTest extends Common_TestCase {
+
+    protected function setUp() {
+        parent::setUp();
+        $this->objSiteSession = new SC_SiteSession_Ex();
+    }
+
+    protected function tearDown() {
+        parent::tearDown();
+    }
+
+    /////////////////////////////////////////
+
+    public function testSetNowPage_now_pageにパスを設定する() {
+        $this->expected = 'test.php';
+        $this->objSiteSession->setNowPage('test.php');
+        $this->actual = $_SESSION['site']['now_page'];
+        $this->verify("ベージセット");
+    }
+}
+
