1
0
mirror of https://github.com/danog/amp.git synced 2024-11-27 04:24:42 +01:00
amp/test/FailureTest.php
2014-12-01 19:45:57 -05:00

18 lines
422 B
PHP

<?php
namespace Amp\Test;
use Amp\Failure;
class FailureTest extends \PHPUnit_Framework_TestCase {
public function testWhenInvokedImmediately() {
$exception = new \Exception('test');
$failure = new Failure($exception);
$failure->when(function($error, $result) use ($exception) {
$this->assertNull($result);
$this->assertSame($exception, $error);
});
}
}