1
0
mirror of https://github.com/danog/file.git synced 2024-12-04 18:28:11 +01:00
file/test/Driver/UvFileTest.php

28 lines
644 B
PHP
Raw Normal View History

2020-06-30 21:45:09 +02:00
<?php
namespace Amp\File\Test\Driver;
use Amp\File;
2022-02-08 19:49:16 +01:00
use Amp\File\Driver\UvFilesystemDriver;
2020-06-30 21:45:09 +02:00
use Amp\File\Test\AsyncFileTest;
2021-10-16 04:53:50 +02:00
use Revolt\EventLoop;
use Revolt\EventLoop\Driver\UvDriver as UvLoopDriver;
2020-06-30 21:45:09 +02:00
class UvFileTest extends AsyncFileTest
{
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();
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
}
}