Skip to content

Commit

Permalink
chore: enabled swoole tests for php 8.3, this extension is available now
Browse files Browse the repository at this point in the history
  • Loading branch information
jklab committed Nov 27, 2024
1 parent 84c3734 commit d2fb0ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
18 changes: 6 additions & 12 deletions tests/FileLockResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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
Expand Down Expand Up @@ -387,9 +384,6 @@ private function cleanUpLockFileDirs(): void
}

rmdir(self::$mainLockFileDirPath);

if (is_dir(self::$localLockFileDirPath)) {
rmdir(self::$localLockFileDirPath);
}
rmdir(self::$unWriteableFileDirPath);
}
}
4 changes: 2 additions & 2 deletions tests/SwooleSequenceResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down

0 comments on commit d2fb0ff

Please sign in to comment.