Skip to content

Commit

Permalink
Removed the low version conditions of php and swoole (#6489)
Browse files Browse the repository at this point in the history
  • Loading branch information
guandeng authored Jan 22, 2024
1 parent 7752db2 commit 5f3bb35
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
12 changes: 3 additions & 9 deletions tests/Filesystem/FilesystemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,11 @@ public function testFopenInCoroutine()
public function testMakeDirection()
{
$system = new Filesystem();
if (SWOOLE_VERSION_ID > 40701) {
try {
$system->makeDirectory(BASE_PATH . '/runtime/test');
$system->makeDirectory(BASE_PATH . '/runtime/test');
} catch (Throwable $exception) {
$this->assertSame('mkdir(): File exists', $exception->getMessage());
}
} else {
try {
$system->makeDirectory(BASE_PATH . '/runtime/test');
$system->makeDirectory(BASE_PATH . '/runtime/test');
$this->assertTrue(true);
} catch (Throwable $exception) {
$this->assertSame('mkdir(): File exists', $exception->getMessage());
}
}

Expand Down
12 changes: 2 additions & 10 deletions tests/Reflection/ClassInvokerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,7 @@ public function testClassInvokerCallNotExistMethod()
$invoker = new ClassInvoker(new Caller());

$this->expectException(ReflectionException::class);
if (version_compare(PHP_VERSION, '8.0', '>=')) {
$this->expectExceptionMessage('Method HyperfTest\Support\Reflection\Caller::zero() does not exist');
} else {
$this->expectExceptionMessage('Method zero does not exist');
}
$this->expectExceptionMessage('Method HyperfTest\Support\Reflection\Caller::zero() does not exist');
$invoker->zero();
}

Expand All @@ -69,11 +65,7 @@ public function testClassInvokerGetNotExistProperty()
$invoker = new ClassInvoker(new Caller());

$this->expectException(ReflectionException::class);
if (version_compare(PHP_VERSION, '8.0', '>=')) {
$this->expectExceptionMessage('Property HyperfTest\Support\Reflection\Caller::$zero does not exist');
} else {
$this->expectExceptionMessage('Property zero does not exist');
}
$this->expectExceptionMessage('Property HyperfTest\Support\Reflection\Caller::$zero does not exist');
$invoker->zero;
}
}
Expand Down

0 comments on commit 5f3bb35

Please sign in to comment.