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:
parent
dbb066aa1d
commit
6a506de7ad
@ -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', '<');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user