1
0
mirror of https://github.com/danog/file.git synced 2024-12-12 09:19:48 +01:00
file/test/Driver/UvFilesystemDriverTest.php

42 lines
1.0 KiB
PHP
Raw Normal View History

<?php
2015-07-11 03:59:39 +02:00
2020-06-30 21:45:09 +02:00
namespace Amp\File\Test\Driver;
2015-07-11 03:59:39 +02:00
2017-06-20 19:37:41 +02:00
use Amp\File;
2022-02-08 19:49:16 +01:00
use Amp\File\Driver\UvFilesystemDriver;
use Amp\File\Test\FilesystemDriverTest;
2021-10-16 04:53:50 +02:00
use Revolt\EventLoop;
use Revolt\EventLoop\Driver\UvDriver as UvLoopDriver;
2022-02-08 19:49:16 +01:00
class UvFilesystemDriverTest extends FilesystemDriverTest
{
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
*/
2022-02-08 22:06:40 +01:00
public function testResolveSymlinkError(\Closure $linkResolver): void
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-16 04:53:50 +02:00
parent::testResolveSymlinkError($linkResolver);
2020-05-02 09:39:57 +02:00
}
2020-06-30 21:45:09 +02:00
2022-02-08 19:49:16 +01:00
protected function createDriver(): File\FilesystemDriver
2020-06-30 21:45:09 +02:00
{
if (!\extension_loaded("uv")) {
2021-10-16 04:53:50 +02:00
$this->markTestSkipped("ext-uv not loaded");
2020-06-30 21:45:09 +02:00
}
2021-10-16 04:53:50 +02:00
$loop = EventLoop::getDriver();
2020-06-30 21:45:09 +02:00
2021-10-16 04:53:50 +02:00
if (!$loop instanceof UvLoopDriver) {
$this->markTestSkipped("Loop driver must be using ext-uv");
}
2020-06-30 21:45:09 +02:00
2022-02-08 19:49:16 +01:00
return new UvFilesystemDriver($loop);
2020-06-30 21:45:09 +02:00
}
2015-08-08 16:09:07 +02:00
}