silverstripe-framework/tests/FakeController.php
Sam Minnee 1f7fc1f76a FIX Remove instances of lines longer than 120c
The entire framework repo (with the exception of system-generated files) has been amended to respect the 120c line-length limit.  This is in preparation for the enforcement of this rule with PHP_CodeSniffer.
2012-09-30 17:18:13 +13:00

24 lines
533 B
PHP

<?php
// Fake a current controller. Way harder than it should be
class FakeController extends Controller {
public function __construct() {
parent::__construct();
$session = new Session(isset($_SESSION) ? $_SESSION : null);
$this->setSession($session);
$this->pushCurrent();
$this->request = new SS_HTTPRequest(
(isset($_SERVER['X-HTTP-Method-Override']))
? $_SERVER['X-HTTP-Method-Override']
: $_SERVER['REQUEST_METHOD'],
'/'
);
$this->response = new SS_HTTPResponse();
$this->init();
}
}