Skip to content

Commit

Permalink
API phpunit 9 support
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Oct 27, 2021
1 parent f6e001b commit 05dd7bc
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 25 deletions.
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [],
Expand Down
8 changes: 5 additions & 3 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -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">
Expand Down
2 changes: 0 additions & 2 deletions tests/Checks/DatabaseCheckTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
/**
* Class DatabaseCheckTest
*
* @mixin PHPUnit_Framework_TestCase
*
* @package environmentcheck
*/
class DatabaseCheckTest extends SapphireTest
Expand Down
2 changes: 0 additions & 2 deletions tests/Checks/ExternalURLCheckTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
/**
* Class ExternalURLCheckTest
*
* @mixin PHPUnit_Framework_TestCase
*
* @package environmentcheck
*/
class ExternalURLCheckTest extends SapphireTest
Expand Down
2 changes: 0 additions & 2 deletions tests/Checks/FileWritableCheckTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
/**
* Class FileWritableCheckTest
*
* @mixin PHPUnit_Framework_TestCase
*
* @package environmentcheck
*/
class FileWritableCheckTest extends SapphireTest
Expand Down
2 changes: 0 additions & 2 deletions tests/Checks/HasClassCheckTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
/**
* Class HasClassCheckTest
*
* @mixin PHPUnit_Framework_TestCase
*
* @package environmentcheck
*/
class HasClassCheckTest extends SapphireTest
Expand Down
2 changes: 0 additions & 2 deletions tests/Checks/HasFunctionCheckTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
/**
* Class HasFunctionCheckTest
*
* @mixin PHPUnit_Framework_TestCase
*
* @package environmentcheck
*/
class HasFunctionCheckTest extends SapphireTest
Expand Down
2 changes: 1 addition & 1 deletion tests/Checks/SessionCheckTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class SessionCheckTest extends SapphireTest
*
* @return void
*/
protected function setUp()
protected function setUp(): void
{
parent::setUp();
$this->sessionCheck = new SessionCheck('/');
Expand Down
2 changes: 0 additions & 2 deletions tests/Checks/URLCheckTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
/**
* Class URLCheckTest
*
* @mixin PHPUnit_Framework_TestCase
*
* @package environmentcheck
*/
class URLCheckTest extends SapphireTest
Expand Down
2 changes: 0 additions & 2 deletions tests/Controllers/DevCheckControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
/**
* Class DevCheckControllerTest
*
* @mixin PHPUnit_Framework_TestCase
*
* @package environmentcheck
*/
class DevCheckControllerTest extends SapphireTest
Expand Down
2 changes: 0 additions & 2 deletions tests/Controllers/DevHealthControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
/**
* Class DevHealthControllerTest
*
* @mixin PHPUnit_Framework_TestCase
*
* @package environmentcheck
*/
class DevHealthControllerTest extends SapphireTest
Expand Down
6 changes: 3 additions & 3 deletions tests/EnvironmentCheckerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class EnvironmentCheckerTest extends SapphireTest
{
protected $usesDatabase = true;

protected function tearDown()
protected function tearDown(): void
{
EnvironmentCheckSuite::reset();
parent::tearDown();
Expand Down Expand Up @@ -61,8 +61,8 @@ public function testLogsWithWarnings()
$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);
Expand Down

0 comments on commit 05dd7bc

Please sign in to comment.