Add PHPUnit 8 support

This commit is contained in:
Dan Hensby 2020-03-26 16:46:18 +00:00
parent f7632a8df4
commit 4cec42ab96
No known key found for this signature in database
GPG Key ID: F76D6B5FE0626A99
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/vendor-plugin": "^1.3"
},
"require-dev": {
"phpunit/phpunit": "^8 || ^9"
},
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
@ -35,5 +38,6 @@
"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 LogicException;
use PHPUnit\Framework\MockObject\MockObject;
use SilverStripe\Control\Director;
use SilverStripe\Control\Email\Mailer;
use SilverStripe\Control\HTTPRequest;
@ -22,13 +23,13 @@ use SilverStripe\Core\Config\Config;
class TestSessionControllerTest extends SapphireTest
{
/**
* @var TestSessionEnvironment|PHPUnit_Framework_MockObject_MockObject
* @var TestSessionEnvironment|MockObject
*/
private $testSessionEnvironment;
protected $usesDatabase = true;
protected function setUp()
protected function setUp() : void
{
parent::setUp();
Injector::inst()->unregisterNamedObject(TestSessionEnvironment::class);

View File

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

View File

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