diff --git a/tests/Filesystem/FilesystemTest.php b/tests/Filesystem/FilesystemTest.php index 17496ce..68ca8cb 100644 --- a/tests/Filesystem/FilesystemTest.php +++ b/tests/Filesystem/FilesystemTest.php @@ -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()); } } diff --git a/tests/Reflection/ClassInvokerTest.php b/tests/Reflection/ClassInvokerTest.php index aa37c0f..5a28bec 100644 --- a/tests/Reflection/ClassInvokerTest.php +++ b/tests/Reflection/ClassInvokerTest.php @@ -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(); } @@ -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; } }