Example #1
0
 public function setUp()
 {
     parent::setUp();
     // Hold the original request URI once so it doesn't get overwritten
     if (!self::$originalRequestURI) {
         self::$originalRequestURI = $_SERVER['REQUEST_URI'];
     }
     Config::inst()->update('Director', 'rules', array('DirectorTestRule/$Action/$ID/$OtherID' => 'DirectorTestRequest_Controller', 'en-nz/$Action/$ID/$OtherID' => array('Controller' => 'DirectorTestRequest_Controller', 'Locale' => 'en_NZ')));
 }
 function setUp()
 {
     parent::setUp();
     // Hold the original request URI once so it doesn't get overwritten
     if (!self::$originalRequestURI) {
         self::$originalRequestURI = $_SERVER['REQUEST_URI'];
     }
     Director::addRules(99, array('DirectorTestRule/$Action/$ID/$OtherID' => 'DirectorTestRequest_Controller'));
 }
Example #3
0
 public function setUp()
 {
     parent::setUp();
     // Hold the original request URI once so it doesn't get overwritten
     if (!self::$originalRequestURI) {
         self::$originalRequestURI = $_SERVER['REQUEST_URI'];
     }
     $_SERVER['REQUEST_URI'] = 'http://www.mysite.com';
     $this->originalGet = $_GET;
     $this->originalSession = $_SESSION;
     $_SESSION = array();
     Config::inst()->update('Director', 'rules', array('DirectorTestRule/$Action/$ID/$OtherID' => 'DirectorTestRequest_Controller', 'en-nz/$Action/$ID/$OtherID' => array('Controller' => 'DirectorTestRequest_Controller', 'Locale' => 'en_NZ')));
     $headers = array('HTTP_X_FORWARDED_PROTOCOL', 'HTTPS', 'SSL');
     foreach ($headers as $header) {
         if (isset($_SERVER[$header])) {
             $this->originalProtocolHeaders[$header] = $_SERVER[$header];
         }
     }
 }