API phpunit 9 support

This commit is contained in:
Steve Boyd 2021-10-27 18:06:29 +13:00
parent f6e001bf55
commit 05dd7bc0a7
12 changed files with 12 additions and 25 deletions

View File

@ -20,12 +20,13 @@
}
],
"require": {
"silverstripe/framework": "^4.0",
"php": "^7.3 || ^8.0",
"silverstripe/framework": "^4.10",
"silverstripe/versioned": "^1.0",
"guzzlehttp/guzzle": "^6.3.3"
},
"require-dev": {
"sminnee/phpunit": "^5.7",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.0"
},
"extra": [],

View File

@ -1,8 +1,10 @@
<phpunit bootstrap="vendor/silverstripe/framework/tests/bootstrap.php" colors="true">
<testsuite name="Default">
<directory>tests</directory>
</testsuite>
<testsuites>
<testsuite name="Default">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">

View File

@ -10,8 +10,6 @@ use SilverStripe\Security\Member;
/**
* Class DatabaseCheckTest
*
* @mixin PHPUnit_Framework_TestCase
*
* @package environmentcheck
*/
class DatabaseCheckTest extends SapphireTest

View File

@ -9,8 +9,6 @@ use SilverStripe\EnvironmentCheck\EnvironmentCheck;
/**
* Class ExternalURLCheckTest
*
* @mixin PHPUnit_Framework_TestCase
*
* @package environmentcheck
*/
class ExternalURLCheckTest extends SapphireTest

View File

@ -9,8 +9,6 @@ use SilverStripe\Dev\SapphireTest;
/**
* Class FileWritableCheckTest
*
* @mixin PHPUnit_Framework_TestCase
*
* @package environmentcheck
*/
class FileWritableCheckTest extends SapphireTest

View File

@ -9,8 +9,6 @@ use SilverStripe\EnvironmentCheck\EnvironmentCheck;
/**
* Class HasClassCheckTest
*
* @mixin PHPUnit_Framework_TestCase
*
* @package environmentcheck
*/
class HasClassCheckTest extends SapphireTest

View File

@ -9,8 +9,6 @@ use SilverStripe\Dev\SapphireTest;
/**
* Class HasFunctionCheckTest
*
* @mixin PHPUnit_Framework_TestCase
*
* @package environmentcheck
*/
class HasFunctionCheckTest extends SapphireTest

View File

@ -25,7 +25,7 @@ class SessionCheckTest extends SapphireTest
*
* @return void
*/
protected function setUp()
protected function setUp(): void
{
parent::setUp();
$this->sessionCheck = new SessionCheck('/');

View File

@ -9,8 +9,6 @@ use SilverStripe\Dev\SapphireTest;
/**
* Class URLCheckTest
*
* @mixin PHPUnit_Framework_TestCase
*
* @package environmentcheck
*/
class URLCheckTest extends SapphireTest

View File

@ -10,8 +10,6 @@ use SilverStripe\EnvironmentCheck\EnvironmentChecker;
/**
* Class DevCheckControllerTest
*
* @mixin PHPUnit_Framework_TestCase
*
* @package environmentcheck
*/
class DevCheckControllerTest extends SapphireTest

View File

@ -10,8 +10,6 @@ use SilverStripe\EnvironmentCheck\EnvironmentChecker;
/**
* Class DevHealthControllerTest
*
* @mixin PHPUnit_Framework_TestCase
*
* @package environmentcheck
*/
class DevHealthControllerTest extends SapphireTest

View File

@ -20,7 +20,7 @@ class EnvironmentCheckerTest extends SapphireTest
{
protected $usesDatabase = true;
protected function tearDown()
protected function tearDown(): void
{
EnvironmentCheckSuite::reset();
parent::tearDown();
@ -61,8 +61,8 @@ class EnvironmentCheckerTest extends SapphireTest
$logger->expects($this->once())
->method('log')
->withConsecutive(
$this->equalTo(LogLevel::WARNING),
$this->anything()
[$this->equalTo(LogLevel::WARNING)],
[$this->anything()]
);
Injector::inst()->registerService($logger, LoggerInterface::class);