2016-12-29 20:59:59 -06:00
|
|
|
<?php
|
2015-07-10 21:59:39 -04:00
|
|
|
|
2020-06-30 21:45:09 +02:00
|
|
|
namespace Amp\File\Test\Driver;
|
2015-07-10 21:59:39 -04:00
|
|
|
|
2017-06-20 19:37:41 +02:00
|
|
|
use Amp\File;
|
2020-06-30 21:45:09 +02:00
|
|
|
use Amp\File\Driver\UvDriver;
|
|
|
|
use Amp\File\Test\DriverTest;
|
2021-10-15 21:53:50 -05:00
|
|
|
use Revolt\EventLoop;
|
|
|
|
use Revolt\EventLoop\Driver\UvDriver as UvLoopDriver;
|
2017-03-16 22:39:49 -05:00
|
|
|
|
2018-10-27 10:57:31 -05:00
|
|
|
class UvDriverTest extends DriverTest
|
|
|
|
{
|
2020-05-02 09:39:57 +02:00
|
|
|
/**
|
2020-06-24 22:00:24 +02:00
|
|
|
* @dataProvider symlinkPathProvider
|
2020-05-02 09:39:57 +02:00
|
|
|
*
|
|
|
|
* @param \Closure $linkResolver
|
|
|
|
*/
|
2021-10-15 21:53:50 -05:00
|
|
|
public function testResolveSymlinkError(\Closure $linkResolver)
|
2020-05-02 09:39:57 +02:00
|
|
|
{
|
|
|
|
if (\version_compare(\phpversion('uv'), '0.3.0', '<')) {
|
|
|
|
$this->markTestSkipped('UvDriver Test Skipped: Causes Crash');
|
|
|
|
}
|
|
|
|
|
2021-10-15 21:53:50 -05:00
|
|
|
parent::testResolveSymlinkError($linkResolver);
|
2020-05-02 09:39:57 +02:00
|
|
|
}
|
2020-06-30 21:45:09 +02:00
|
|
|
|
|
|
|
protected function createDriver(): File\Driver
|
|
|
|
{
|
|
|
|
if (!\extension_loaded("uv")) {
|
2021-10-15 21:53:50 -05:00
|
|
|
$this->markTestSkipped("ext-uv not loaded");
|
2020-06-30 21:45:09 +02:00
|
|
|
}
|
|
|
|
|
2021-10-15 21:53:50 -05:00
|
|
|
$loop = EventLoop::getDriver();
|
2020-06-30 21:45:09 +02:00
|
|
|
|
2021-10-15 21:53:50 -05:00
|
|
|
if (!$loop instanceof UvLoopDriver) {
|
|
|
|
$this->markTestSkipped("Loop driver must be using ext-uv");
|
|
|
|
}
|
2020-06-30 21:45:09 +02:00
|
|
|
|
|
|
|
return new UvDriver($loop);
|
|
|
|
}
|
2015-08-08 10:09:07 -04:00
|
|
|
}
|