1
0
mirror of https://github.com/danog/amp.git synced 2024-11-27 12:35:02 +01:00
amp/test/SuccessTest.php
2014-09-22 22:21:22 -04:00

24 lines
563 B
PHP

<?php
namespace AlertTest;
use Alert\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());
}
}