diff --git a/src/UvDriver.php b/src/UvDriver.php index d3e6a40..887898e 100644 --- a/src/UvDriver.php +++ b/src/UvDriver.php @@ -41,7 +41,7 @@ public function __construct(Loop\UvDriver $driver) $this->loop = $driver->getHandle(); $this->poll = new Internal\UvPoll; - $this->priorVersion = \version_compare('0.3.0', \phpversion('uv')) < 0; + $this->priorVersion = \version_compare(\phpversion('uv'), '0.3.0', '<'); } /** diff --git a/src/UvFile.php b/src/UvFile.php index a37bd5d..a3d6eb1 100644 --- a/src/UvFile.php +++ b/src/UvFile.php @@ -68,7 +68,7 @@ public function __construct(Loop\UvDriver $driver, Internal\UvPoll $poll, $fh, s $this->queue = new \SplQueue; - $this->priorVersion = \version_compare('0.3.0', \phpversion('uv')) < 0; + $this->priorVersion = \version_compare(\phpversion('uv'), '0.3.0', '<'); } public function read(int $length = self::DEFAULT_READ_LENGTH): Promise diff --git a/test/UvDriverTest.php b/test/UvDriverTest.php index 740b20c..20c9857 100644 --- a/test/UvDriverTest.php +++ b/test/UvDriverTest.php @@ -21,4 +21,18 @@ protected function setUp(): void Loop::set($loop); File\filesystem(new File\UvDriver($loop)); } + + /** + * @dataProvider readlinkPathProvider + * + * @param \Closure $linkResolver + */ + public function testReadlinkError(\Closure $linkResolver): \Generator + { + if (\version_compare(\phpversion('uv'), '0.3.0', '<')) { + $this->markTestSkipped('UvDriver Test Skipped: Causes Crash'); + } + + yield from parent::testReadlinkError($linkResolver); + } }