1
0
mirror of https://github.com/danog/file.git synced 2024-11-26 20:04:51 +01:00

Fix UvDriver (#46)

This commit is contained in:
Jáchym Toušek 2020-05-02 09:39:57 +02:00 committed by GitHub
parent dbb066aa1d
commit 6a506de7ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 2 deletions

View File

@ -41,7 +41,7 @@ final class UvDriver implements 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', '<');
}
/**

View File

@ -68,7 +68,7 @@ final class UvFile implements File
$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

View File

@ -21,4 +21,18 @@ class UvDriverTest extends DriverTest
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);
}
}