source: branches/version-2_12-dev/tests/class/replace/SC_Response_Ex.php @ 22796

Revision 22796, 1.2 KB checked in by h_yoshimoto, 11 years ago (diff)

#2236 2.12.3リリース以降の2.12-devへのコミット差し戻し

Line 
1<?php
2require_once(realpath(dirname(__FILE__)) . "/../../../data/class/SC_Response.php");
3/**
4 * テスト用にexitしないSC_Responseクラスです。
5 */
6class SC_Response_Ex extends SC_Response {
7
8  /** exitしたかどうかを保持するフラグ */
9  var $exited = FALSE;
10  /** リダイレクト先のパスを保持するフラグ */
11  var $redirectPath = '';
12
13  /**
14   * SC_Response::actionExit()をラップし、PHPをexitさせないようにします。
15   */
16  function actionExit() {
17    $this->exited = TRUE;
18  }
19
20  /**
21   * SC_Response::sendRedirect()をラップし、PHPをexitさせないようにします。
22   * また、リダイレクト先のパスを取得できるようにします。
23   */
24  function sendRedirect($location, $arrQueryString = array(), $inheritQuerySring = false, $useSsl = null) {
25    $this->exited = TRUE;
26    $this->redirectPath = $location;
27  }
28
29  /**
30   * actionExit()が呼ばれたかどうかを取得します。
31   */
32  public function isExited() {
33    return $this->exited;
34  }
35
36  /**
37   * sendRedirect()で指定されたパスを取得します。
38   */
39  public function getRedirectPath() {
40    return $this->redirectPath;
41  }
42}
43
44
Note: See TracBrowser for help on using the repository browser.