diff --git a/tests/FileLockResolverTest.php b/tests/FileLockResolverTest.php index de84350..5813b3f 100644 --- a/tests/FileLockResolverTest.php +++ b/tests/FileLockResolverTest.php @@ -18,19 +18,20 @@ class FileLockResolverTest extends TestCase { private static string $mainLockFileDirPath; - private static string $localLockFileDirPath; + private static string $unWriteableFileDirPath; private FileLockResolver $fileLocker; public static function setUpBeforeClass(): void { self::$mainLockFileDirPath = dirname(__DIR__) . '/.locks'; - self::$localLockFileDirPath = __DIR__ . '/.locks'; + self::$unWriteableFileDirPath = __DIR__ . '/.locks'; } protected function setUp(): void { mkdir(self::$mainLockFileDirPath, 0777); + mkdir(self::$unWriteableFileDirPath, 0444); $this->fileLocker = new FileLockResolver(self::$mainLockFileDirPath); } @@ -52,13 +53,9 @@ public function test_prepare_path_not_writable(): void $resolver = new FileLockResolver('/tmp/'); $this->assertEquals('/tmp/', $this->invokeProperty($resolver, 'lockFileDir')); - if (! is_dir(self::$localLockFileDirPath)) { - mkdir(self::$localLockFileDirPath, 0444); - } - $this->expectException(\Exception::class); - $this->expectExceptionMessage(self::$localLockFileDirPath.' is not writable.'); - $resolver = new FileLockResolver(self::$localLockFileDirPath); + $this->expectExceptionMessage(self::$unWriteableFileDirPath.' is not writable.'); + $resolver = new FileLockResolver(self::$unWriteableFileDirPath); } public function test_array_slice(): void @@ -387,9 +384,6 @@ private function cleanUpLockFileDirs(): void } rmdir(self::$mainLockFileDirPath); - - if (is_dir(self::$localLockFileDirPath)) { - rmdir(self::$localLockFileDirPath); - } + rmdir(self::$unWriteableFileDirPath); } } diff --git a/tests/SwooleSequenceResolverTest.php b/tests/SwooleSequenceResolverTest.php index 84b1b30..020eb1f 100644 --- a/tests/SwooleSequenceResolverTest.php +++ b/tests/SwooleSequenceResolverTest.php @@ -18,8 +18,8 @@ class SwooleSequenceResolverTest extends TestCase { public function setUp(): void { - if (version_compare(PHP_VERSION, '8.3') >= 0) { - $this->markTestSkipped('Swoole does not yet support PHP 8.3'); + if (version_compare(PHP_VERSION, '8.4') >= 0) { + $this->markTestSkipped('Swoole does not yet support PHP 8.4'); } if (! extension_loaded('swoole')) {