Skip to content

Commit 05abfc3

Browse files
committed
Add tests for When::lazy
1 parent 86896ef commit 05abfc3

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
namespace React\Promise;
4+
5+
/**
6+
* @group When
7+
* @group WhenLazy
8+
*/
9+
class WhenLazyTest extends TestCase
10+
{
11+
/** @test */
12+
public function shouldReturnALazyPromise()
13+
{
14+
$this->assertInstanceOf('React\\Promise\\PromiseInterface', When::lazy(function () {}));
15+
}
16+
17+
/** @test */
18+
public function shouldCallFactoryIfThenIsInvoked()
19+
{
20+
$factory = $this->createCallableMock();
21+
$factory
22+
->expects($this->once())
23+
->method('__invoke');
24+
25+
When::lazy($factory)
26+
->then();
27+
}
28+
}

0 commit comments

Comments
 (0)