1
0
mirror of https://github.com/danog/amp.git synced 2024-12-02 09:27:46 +01:00
amp/test/SuccessTest.php
2014-09-23 00:06:03 -04:00

24 lines
560 B
PHP

<?php
namespace Amp\Test;
use Amp\Success;
class SuccessTest extends \PHPUnit_Framework_TestCase {
public function testWhenInvokedImmediately() {
$value = 42;
$success = new Success($value);
$success->when(function($error, $result) use ($value) {
$this->assertNull($error);
$this->assertSame($value, $result);
});
}
public function testWaitReturnsResolvedValue() {
$value = 42;
$success = new Success($value);
$this->assertSame($value, $success->wait());
}
}