objQuery = SC_Query_Ex::getSingletonInstance('', true); $this->objQuery->begin(); } protected function tearDown() { $this->objQuery->rollback(); $this->objQuery = null; } /** * 各テストfunctionの末尾で呼び出し、期待値と実際の値の比較を行います。 * 呼び出す前に、$expectedに期待値を、$actualに実際の値を導入してください。 */ protected function verify($message = null) { $this->assertEquals($this->expected, $this->actual, $message); } ////////////////////////////////////////////////////////////////// // 以下はテスト用のユーティリティを使うためのサンプルです。 // 実際に動作させる場合にはコメントアウトを外して下さい。 /** * actionExit()呼び出しを書き換えてexit()させない例です。 */ /** public function testExit() { $resp = new SC_Response_Ex(); $resp->actionExit(); $this->expected = TRUE; $this->actual = $resp->isExited(); $this->verify('exitしたかどうか'); } */ /** * 端末種別をテストケースから自由に設定する例です。 */ /** public function testDeviceType() { $this->expected = array(DEVICE_TYPE_MOBILE, DEVICE_TYPE_SMARTPHONE); $this->actual = array(); // 端末種別を設定 User_Utils::setDeviceType(DEVICE_TYPE_MOBILE); $this->actual[0] = SC_Display_Ex::detectDevice(); User_Utils::setDeviceType(DEVICE_TYPE_SMARTPHONE); $this->actual[1] = SC_Display_Ex::detectDevice(); $this->verify('端末種別'); } */ /** * ログイン状態をテストケースから自由に切り替える例です。 */ /** public function testLoginState() { $this->expected = array(FALSE, TRUE); $this->actual = array(); $objCustomer = new SC_Customer_Ex(); User_Utils::setLoginState(FALSE); $this->actual[0] = $objCustomer->isLoginSuccess(); User_Utils::setLoginState(TRUE, null, $this->objQuery); $this->actual[1] = $objCustomer->isLoginSuccess(); $this->verify('ログイン状態'); } */ }