From 0662a9ad90e8922c3a36f84454bd0faca307b233 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Sat, 10 Sep 2016 11:17:55 +1200 Subject: [PATCH 1/2] FIX: Fixes for final 4.0-alpha2 class names. --- code/TestSessionController.php | 4 ++-- code/TestSessionRequestFilter.php | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/code/TestSessionController.php b/code/TestSessionController.php index 4191482..46fa667 100644 --- a/code/TestSessionController.php +++ b/code/TestSessionController.php @@ -3,7 +3,7 @@ use SilverStripe\Control\Controller; use SilverStripe\Control\Director; use SilverStripe\Control\Session; -use SilverStripe\Control\SS_HTTPRequest; +use SilverStripe\Control\HTTPRequest; use SilverStripe\Core\Injector\Injector; use SilverStripe\Dev\Deprecation; use SilverStripe\Dev\SapphireTest; @@ -163,7 +163,7 @@ public function start() /** * Set $_SESSION state for the current browser session. * - * @param SS_HTTPRequest $request + * @param HTTPRequest $request */ public function browsersessionstate($request) { diff --git a/code/TestSessionRequestFilter.php b/code/TestSessionRequestFilter.php index 88fd748..70ea3d3 100644 --- a/code/TestSessionRequestFilter.php +++ b/code/TestSessionRequestFilter.php @@ -4,12 +4,13 @@ use SilverStripe\ORM\FieldType\DBDatetime; use SilverStripe\ORM\DB; use SilverStripe\Core\Injector\Injector; -use SilverStripe\Control\SS_HTTPRequest; use SilverStripe\Control\Session; use SilverStripe\Core\Config\Config; use SilverStripe\Control\Director; -use SilverStripe\Control\SS_HTTPResponse; use SilverStripe\Control\RequestFilter; +use SilverStripe\Control\HTTPRequest; +use SilverStripe\Control\HTTPResponse; + /** @@ -28,7 +29,7 @@ public function __construct() $this->testSessionEnvironment = Injector::inst()->get('TestSessionEnvironment'); } - public function preRequest(SS_HTTPRequest $request, Session $session, DataModel $model) + public function preRequest(HTTPRequest $request, Session $session, DataModel $model) { if (!$this->testSessionEnvironment->isRunningTests()) { return; @@ -66,7 +67,7 @@ public function preRequest(SS_HTTPRequest $request, Session $session, DataModel } } - public function postRequest(SS_HTTPRequest $request, SS_HTTPResponse $response, DataModel $model) + public function postRequest(HTTPRequest $request, HTTPResponse $response, DataModel $model) { if (!$this->testSessionEnvironment->isRunningTests()) { return; From 9b85c801783e2fa2aa5357634537d029104cc828 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Mon, 12 Sep 2016 11:43:12 +1200 Subject: [PATCH 2/2] FIX: Use composer-aware phpunit to run tests. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SilverStripe now requires the phpunit autoloader to work, which means that a non-composer-installed copy of phpunit won’t work. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7bb0701..84d2a6b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,4 +25,4 @@ before_script: - cd ~/builds/ss script: - - phpunit testsession/tests/unit/ + - vendor/bin/phpunit testsession/tests/unit/