2016-06-08 16:12:42 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Amp\Test\Loop;
|
|
|
|
|
|
|
|
use Amp\Loop\EvLoop;
|
|
|
|
use Interop\Async\Loop\DriverFactory;
|
|
|
|
use Interop\Async\Loop\Test;
|
|
|
|
|
2016-12-29 21:47:06 +01:00
|
|
|
/**
|
|
|
|
* @requires extension ev
|
|
|
|
*/
|
2016-06-08 23:03:37 +02:00
|
|
|
class EvLoopTest extends Test {
|
2016-06-08 16:12:42 +02:00
|
|
|
public function getFactory() {
|
2016-06-26 17:35:25 +02:00
|
|
|
if (!EvLoop::supported()) {
|
|
|
|
$this->markTestSkipped("EvLoop is not available");
|
|
|
|
}
|
|
|
|
|
2016-06-08 16:12:42 +02:00
|
|
|
$factory = $this->getMockBuilder(DriverFactory::class)->getMock();
|
|
|
|
|
|
|
|
$factory->method('create')
|
|
|
|
->willReturn(new EvLoop());
|
|
|
|
|
|
|
|
return $factory;
|
|
|
|
}
|
|
|
|
}
|