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

18 lines
422 B
PHP
Raw Normal View History

2014-09-22 22:47:48 +02:00
<?php
2014-09-23 04:38:32 +02:00
namespace Amp\Test;
2014-09-22 22:47:48 +02:00
2014-09-23 04:38:32 +02:00
use Amp\Failure;
2014-09-22 22:47:48 +02:00
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);
});
}
}