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