diff --git a/composer.json b/composer.json index 8e31f95..74f3d6c 100644 --- a/composer.json +++ b/composer.json @@ -13,12 +13,13 @@ "license": "BSD-3-Clause", "minimum-stability": "dev", "require": { + "php": "^7.3 || ^8.0", "league/csv": "^8 || ^9", - "silverstripe/framework": "^4", + "silverstripe/framework": "^4.10", "symbiote/silverstripe-queuedjobs": "^4" }, "require-dev": { - "sminnee/phpunit": "^5.7", + "phpunit/phpunit": "^9.5", "squizlabs/php_codesniffer": "^3.0" }, "extra": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 8700f65..251c15c 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,7 +1,9 @@ - - tests/ - + + + tests/ + + 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); } /**