Damian Mooyman de079c041d API Implement APP object
API Refactor of Session
2017-06-20 16:43:49 +12:00

29 lines
719 B
PHP

<?php
namespace SilverStripe\Control\Tests;
use SilverStripe\Control\Session;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Control\HTTPRequest;
use SilverStripe\Control\HTTPResponse;
use SilverStripe\Control\Controller;
// Fake a current controller. Way harder than it should be
class FakeController extends Controller
{
public function __construct()
{
parent::__construct();
$this->pushCurrent();
$session = new Session(isset($_SESSION) ? $_SESSION : array());
$request = new HTTPRequest('GET', '/');
$request->setSession($session);
$this->setRequest($request);
$this->setResponse(new HTTPResponse());
$this->doInit();
}
}