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 Nov 4, 2021
1 parent adb85fa commit ffbb73f
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 18 deletions.
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@ version: ~> 1.0

import:
- silverstripe/silverstripe-travis-shared:config/provision/standard-jobs-range.yml

env:
global:
- REQUIRE_RECIPE="4.7.x-dev || "
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
}
],
"require": {
"php": "^7.1",
"silverstripe/framework": "^4.7",
"php": "^7.3 || ^8.0",
"silverstripe/framework": "^4.10",
"silverstripe/admin": "^1",
"asyncphp/doorman": "^3.1"
},
"require-dev": {
"sminnee/phpunit": "^5.7",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3"
},
"minimum-stability": "dev",
Expand Down
2 changes: 1 addition & 1 deletion tests/AbstractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

abstract class AbstractTest extends SapphireTest
{
protected function setUp()
protected function setUp(): void
{
parent::setUp();

Expand Down
12 changes: 6 additions & 6 deletions tests/CleanupJobTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class CleanupJobTest extends AbstractTest
/**
* {@inheritDoc}
*/
protected function setUp()
protected function setUp(): void
{
// Have to set a fake time here to work with
// the LastEdited dates in the fixture
Expand All @@ -33,7 +33,7 @@ protected function setUp()
/**
* {@inheritDoc}
*/
protected function tearDown()
protected function tearDown(): void
{
parent::tearDown();
DBDatetime::clear_mock_now();
Expand All @@ -52,7 +52,7 @@ public function testByDays()
);
$job->process();
$data = $job->getJobData();
$this->assertContains("2 jobs cleaned up.", $data->messages[0]);
$this->assertStringContainsString("2 jobs cleaned up.", $data->messages[0]);
}

public function testByNumber()
Expand All @@ -68,7 +68,7 @@ public function testByNumber()
);
$job->process();
$data = $job->getJobData();
$this->assertContains("2 jobs cleaned up.", $data->messages[0]);
$this->assertStringContainsString("2 jobs cleaned up.", $data->messages[0]);
}

public function testByStatus()
Expand All @@ -84,7 +84,7 @@ public function testByStatus()
);
$job->process();
$data = $job->getJobData();
$this->assertContains("3 jobs cleaned up.", $data->messages[0]);
$this->assertStringContainsString("3 jobs cleaned up.", $data->messages[0]);
}

public function testNoCleanup()
Expand All @@ -100,6 +100,6 @@ public function testNoCleanup()
);
$job->process();
$data = $job->getJobData();
$this->assertContains("No jobs to clean up.", $data->messages[0]);
$this->assertStringContainsString("No jobs to clean up.", $data->messages[0]);
}
}
2 changes: 1 addition & 1 deletion tests/QueuedJobsAdminTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class QueuedJobsAdminTest extends FunctionalTest
*
* {@inheritDoc}
*/
protected function setUp()
protected function setUp(): void
{
parent::setUp();

Expand Down
4 changes: 2 additions & 2 deletions tests/QueuedJobsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class QueuedJobsTest extends AbstractTest
/**
* {@inheritDoc}
*/
protected function setUp()
protected function setUp(): void
{
parent::setUp();

Expand All @@ -51,7 +51,7 @@ protected function setUp()
DBDatetime::set_mock_now('2016-01-01 16:00:00');
}

protected function tearDown()
protected function tearDown(): void
{
parent::tearDown();

Expand Down
2 changes: 1 addition & 1 deletion tests/ScheduledExecutionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ScheduledExecutionTest extends AbstractTest
TestScheduledDataObject::class
);

protected function setUp()
protected function setUp(): void
{
parent::setUp();

Expand Down

0 comments on commit ffbb73f

Please sign in to comment.