mirror of
https://github.com/danog/amp.git
synced 2024-11-27 04:24:42 +01:00
18 lines
422 B
PHP
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);
|
|
});
|
|
}
|
|
}
|