-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #446 from creative-commoners/pulls/6/phpunit11
DEP Use PHPUnit 11
- Loading branch information
Showing
9 changed files
with
36 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
/** | ||
* @author Andrew Aitken-Fincham <[email protected]> | ||
*/ | ||
class CleanupJobTest extends AbstractTest | ||
class CleanupJobTest extends SapphireTest | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,6 @@ | |
/** | ||
* Tests for the QueuedJobsAdmin ModelAdmin clas | ||
* | ||
* @coversDefaultClass \Symbiote\QueuedJobs\Controllers\QueuedJobsAdmin | ||
* @package queuedjobs | ||
* @author Robbie Averill <[email protected]> | ||
*/ | ||
|
@@ -73,8 +72,6 @@ public function testConstructorParamsShouldBeATextarea() | |
/** | ||
* Ensure that when a multi-line value is entered for JobParams, it is split by new line and each value | ||
* passed to the constructor of the JobType that is created by the reflection in createjob() | ||
* | ||
* @covers ::createjob | ||
*/ | ||
public function testCreateJobWithConstructorParams() | ||
{ | ||
|
@@ -95,9 +92,6 @@ public function testCreateJobWithConstructorParams() | |
$this->admin->createjob($form->getData(), $form); | ||
} | ||
|
||
/** | ||
* @covers ::createjob | ||
*/ | ||
public function testCreateJobWithStartAfterOption() | ||
{ | ||
$startTimeAfter = DBDatetime::now(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,11 +19,13 @@ | |
use Symbiote\QueuedJobs\Tests\QueuedJobsTest\TestExceptingJob; | ||
use Symbiote\QueuedJobs\Tests\QueuedJobsTest\TestQJService; | ||
use Symbiote\QueuedJobs\Tests\QueuedJobsTest\TestQueuedJob; | ||
use PHPUnit\Framework\Attributes\DataProvider; | ||
use SilverStripe\Dev\SapphireTest; | ||
|
||
/** | ||
* @author Marcus Nyeholt <[email protected]> | ||
*/ | ||
class QueuedJobsTest extends AbstractTest | ||
class QueuedJobsTest extends SapphireTest | ||
{ | ||
/** | ||
* We need the DB for this test | ||
|
@@ -746,8 +748,8 @@ public function testGrabMutex(): void | |
* @param array $jobs | ||
* @param int $expected | ||
* @throws ValidationException | ||
* @dataProvider jobsProvider | ||
*/ | ||
#[DataProvider('jobsProvider')] | ||
public function testBrokenJobNotification(array $jobs, int $expected): void | ||
{ | ||
/** @var QueuedJobDescriptor $descriptor */ | ||
|
@@ -776,8 +778,8 @@ public function testBrokenJobNotification(array $jobs, int $expected): void | |
* @param int $expected | ||
* @throws ValidationException | ||
* @throws Exception | ||
* @dataProvider healthCheckProvider | ||
*/ | ||
#[DataProvider('healthCheckProvider')] | ||
public function testExcludeTasksFromHealthCheck(string $jobClass, int $expected): void | ||
{ | ||
$service = $this->getService(); | ||
|
@@ -802,7 +804,7 @@ public function testExcludeTasksFromHealthCheck(string $jobClass, int $expected) | |
); | ||
} | ||
|
||
public function jobsProvider(): array | ||
public static function jobsProvider(): array | ||
{ | ||
return [ | ||
[ | ||
|
@@ -824,15 +826,15 @@ public function jobsProvider(): array | |
]; | ||
} | ||
|
||
public function healthCheckProvider(): array | ||
public static function healthCheckProvider(): array | ||
{ | ||
return [ | ||
[TestExceptingJob::class, 1], | ||
[RunBuildTaskJob::class, 0], | ||
]; | ||
} | ||
|
||
public function provideGetQueue(): array | ||
public static function provideGetQueue(): array | ||
{ | ||
return [ | ||
'immediate const' => [ | ||
|
@@ -878,9 +880,7 @@ public function provideGetQueue(): array | |
]; | ||
} | ||
|
||
/** | ||
* @dataProvider provideGetQueue | ||
*/ | ||
#[DataProvider('provideGetQueue')] | ||
public function testGetQueue(int|string $queue, ?string $expected): void | ||
{ | ||
$this->assertSame($expected, AbstractQueuedJob::getQueue($queue)); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,12 +7,13 @@ | |
use SilverStripe\ORM\DataObject; | ||
use SilverStripe\ORM\FieldType\DBDatetime; | ||
use Symbiote\QueuedJobs\Tests\ScheduledExecutionTest\TestScheduledDataObject; | ||
use Symbiote\QueuedJobs\Services\QueuedJobService; | ||
|
||
/** | ||
* @author [email protected] | ||
* @license BSD License http://silverstripe.org/bsd-license/ | ||
*/ | ||
class ScheduledExecutionTest extends AbstractTest | ||
class ScheduledExecutionTest extends SapphireTest | ||
{ | ||
/** | ||
* We need the DB for this test | ||
|
@@ -34,6 +35,8 @@ protected function setUp(): void | |
parent::setUp(); | ||
|
||
DBDatetime::set_mock_now('2018-05-28 13:15:00'); | ||
// The shutdown handler doesn't play nicely with SapphireTest's database handling | ||
QueuedJobService::config()->set('use_shutdown_function', false); | ||
} | ||
|
||
public function testScheduledExecutionTimes() | ||
|