diff --git a/composer.json b/composer.json index 8e31f95..1b9ade3 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "symbiote/silverstripe-queuedjobs": "^4" }, "require-dev": { - "sminnee/phpunit": "^5.7", + "phpunit/phpunit": "^9", "squizlabs/php_codesniffer": "^3.0" }, "extra": { diff --git a/src/Jobs/GenerateCSVJob.php b/src/Jobs/GenerateCSVJob.php index 9cbb9dd..7b758aa 100644 --- a/src/Jobs/GenerateCSVJob.php +++ b/src/Jobs/GenerateCSVJob.php @@ -387,7 +387,7 @@ protected function outputRows(GridField $gridField, $columns, $start, $count) } } - public function setup() + public function setUp() { parent::setup(); $gridField = $this->getGridField(); diff --git a/tests/GenerateCSVJobTest.php b/tests/GenerateCSVJobTest.php index 507f83f..c5dd060 100644 --- a/tests/GenerateCSVJobTest.php +++ b/tests/GenerateCSVJobTest.php @@ -19,7 +19,7 @@ class GenerateCSVJobTest extends SapphireTest protected static $extra_controllers = [GenerateCSVJobTestController::class]; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -32,7 +32,7 @@ protected function setUp() protected $paths = []; - protected function tearDown() + protected function tearDown(): void { foreach ($this->paths as $path) { Filesystem::removeFolder(dirname($path)); @@ -57,7 +57,7 @@ public function testGenerateExport() $this->paths[] = $path; // Mark for cleanup later // Test that the job runs - $this->assertFileNotExists($path); + $this->assertFileDoesNotExist($path); $job->setup(); $job->process(); $job->afterComplete(); @@ -72,8 +72,8 @@ public function testGenerateExport() ]; $actual = file_get_contents($path); // Note: strtolower() is for case insensitive comparison, since field label casing changed in SS 4.3 - $this->assertContains('title,content,"publish on"', strtolower($actual)); - $this->assertContains(implode("\r\n", $expected), $actual); + $this->assertStringContainsString('title,content,"publish on"', strtolower($actual)); + $this->assertStringContainsString(implode("\r\n", $expected), $actual); } public function testGenerateExportOverMultipleSteps() @@ -96,7 +96,7 @@ public function testGenerateExportOverMultipleSteps() $this->paths[] = $path; // Mark for cleanup later // Test that the job runs - $this->assertFileNotExists($path); + $this->assertFileDoesNotExist($path); $count = 0; while (!$job->jobFinished()) { ++$count; @@ -120,8 +120,8 @@ public function testGenerateExportOverMultipleSteps() ]; $actual = file_get_contents($path); // Note: strtolower() is for case insensitive comparison, since field label casing changed in SS 4.3 - $this->assertContains('title,content,"publish on"', strtolower($actual)); - $this->assertContains(implode("\r\n", $expected), $actual); + $this->assertStringContainsString('title,content,"publish on"', strtolower($actual)); + $this->assertStringContainsString(implode("\r\n", $expected), $actual); } /**