2015-07-20 15:42:42 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Amp\Test;
|
|
|
|
|
|
|
|
use Amp\EvReactor;
|
|
|
|
|
|
|
|
class EvReactorTest extends ReactorTest {
|
2015-07-29 01:15:43 -04:00
|
|
|
protected function setUp() {
|
2015-07-20 15:42:42 -04:00
|
|
|
if (extension_loaded("ev")) {
|
2015-07-29 01:15:43 -04:00
|
|
|
\Amp\reactor($assign = new EvReactor);
|
2015-07-20 15:42:42 -04:00
|
|
|
} else {
|
|
|
|
$this->markTestSkipped(
|
|
|
|
"ev extension not loaded"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2015-07-22 11:38:17 -04:00
|
|
|
|
2015-07-29 01:15:43 -04:00
|
|
|
public function testGetLoop() {
|
|
|
|
$result = \Amp\reactor()->getLoop();
|
|
|
|
$this->assertInstanceOf("EvLoop", $result);
|
|
|
|
}
|
|
|
|
|
2015-07-22 11:38:17 -04:00
|
|
|
public function testImmediateCoroutineResolutionError() {
|
|
|
|
if (\extension_loaded("xdebug")) {
|
|
|
|
$this->markTestSkipped(
|
|
|
|
"Cannot run this test with xdebug enabled: it causes zend_mm_heap corrupted"
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
parent::testImmediateCoroutineResolutionError();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testOnErrorFailure() {
|
|
|
|
if (\extension_loaded("xdebug")) {
|
|
|
|
$this->markTestSkipped(
|
|
|
|
"Cannot run this test with xdebug enabled: it causes zend_mm_heap corrupted"
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
parent::testImmediateCoroutineResolutionError();
|
|
|
|
}
|
|
|
|
}
|
2015-07-20 15:42:42 -04:00
|
|
|
}
|