Merge pull request #71 from dhensby/pulls/5/phpunit-8

Add PHPUnit 8 support
This commit is contained in:
Daniel Hensby 2020-03-26 17:01:34 +00:00 committed by GitHub
commit c8344b2325
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 5 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/vendor/

View File

@ -18,6 +18,9 @@
"silverstripe/framework": "^5", "silverstripe/framework": "^5",
"silverstripe/vendor-plugin": "^1.3" "silverstripe/vendor-plugin": "^1.3"
}, },
"require-dev": {
"phpunit/phpunit": "^8 || ^9"
},
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "3.x-dev" "dev-master": "3.x-dev"
@ -35,5 +38,6 @@
"SilverStripe\\TestSession\\Tests\\": "tests/" "SilverStripe\\TestSession\\Tests\\": "tests/"
} }
}, },
"minimum-stability": "dev" "minimum-stability": "dev",
"prefer-stable": true
} }

View File

@ -4,6 +4,7 @@ namespace SilverStripe\TestSession\Tests\Unit;
use DateTime; use DateTime;
use LogicException; use LogicException;
use PHPUnit\Framework\MockObject\MockObject;
use SilverStripe\Control\Director; use SilverStripe\Control\Director;
use SilverStripe\Control\Email\Mailer; use SilverStripe\Control\Email\Mailer;
use SilverStripe\Control\HTTPRequest; use SilverStripe\Control\HTTPRequest;
@ -22,13 +23,13 @@ use SilverStripe\Core\Config\Config;
class TestSessionControllerTest extends SapphireTest class TestSessionControllerTest extends SapphireTest
{ {
/** /**
* @var TestSessionEnvironment|PHPUnit_Framework_MockObject_MockObject * @var TestSessionEnvironment|MockObject
*/ */
private $testSessionEnvironment; private $testSessionEnvironment;
protected $usesDatabase = true; protected $usesDatabase = true;
protected function setUp() protected function setUp() : void
{ {
parent::setUp(); parent::setUp();
Injector::inst()->unregisterNamedObject(TestSessionEnvironment::class); Injector::inst()->unregisterNamedObject(TestSessionEnvironment::class);

View File

@ -18,7 +18,7 @@ use stdClass;
class TestSessionEnvironmentTest extends SapphireTest class TestSessionEnvironmentTest extends SapphireTest
{ {
protected function setUp() protected function setUp() : void
{ {
parent::setUp(); parent::setUp();
Injector::inst()->unregisterNamedObject(TestSessionEnvironment::class); Injector::inst()->unregisterNamedObject(TestSessionEnvironment::class);

View File

@ -23,7 +23,7 @@ class TestSessionHTTPMiddlewareTest extends SapphireTest
protected $usesDatabase = true; protected $usesDatabase = true;
protected function setUp() protected function setUp() : void
{ {
parent::setUp(); parent::setUp();
Injector::inst()->registerService( Injector::inst()->registerService(