1
0
mirror of https://github.com/danog/amp.git synced 2024-11-30 04:29:08 +01:00

Add loop tests

This commit is contained in:
Aaron Piotrowski 2016-05-27 15:05:25 -05:00
parent ca827319ec
commit 4aa8c5d550
3 changed files with 50 additions and 0 deletions

View File

@ -13,6 +13,9 @@
"require": {
"async-interop/event-loop": "dev-master"
},
"require-dev": {
"async-interop/event-loop-test": "dev-master"
},
"provide": {
"async-interop/event-loop-implementation": "dev-master"
},

29
phpunit.xml.dist Normal file
View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
>
<testsuites>
<testsuite name="Amp Loop">
<directory>test</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">lib</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="build/coverage" title="Amp" highlight="true"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
</phpunit>

18
test/NativeLoopTest.php Normal file
View File

@ -0,0 +1,18 @@
<?php
namespace Amp\Test\Loop;
use Amp\Loop\NativeLoop;
use Interop\Async\Loop\DriverFactory;
use Interop\Async\Loop\Test;
class NativeLoopTest extends Test {
public function getFactory() {
$factory = $this->getMockBuilder(DriverFactory::class)->getMock();
$factory->method('create')
->willReturn(new NativeLoop());
return $factory;
}
}