generated from kpicaza/package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathReactApplicationFactoryTest.php
38 lines (33 loc) · 1.2 KB
/
ReactApplicationFactoryTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
declare(strict_types=1);
namespace AntidotTest\React;
use Antidot\Application\Http\Response\ErrorResponseGenerator;
use Antidot\Application\Http\Router;
use Antidot\Application\Http\RouteFactory;
use Antidot\Container\MiddlewareFactory;
use Antidot\React\ReactApplicationFactory;
use PHPUnit\Framework\TestCase;
use Psr\Container\ContainerInterface;
class ReactApplicationFactoryTest extends TestCase
{
public function testItShouldCreateInstancesOfReactApplication(): void
{
$container = $this->createMock(ContainerInterface::class);
$container->expects($this->exactly(4))
->method('get')
->withConsecutive(
[Router::class],
[MiddlewareFactory::class],
[RouteFactory::class],
[ErrorResponseGenerator::class],
)
->willReturnOnConsecutiveCalls(
$this->createMock(Router::class),
$this->createMock(MiddlewareFactory::class),
$this->createMock(RouteFactory::class),
$this->createMock(ErrorResponseGenerator::class)
);
$factory = new ReactApplicationFactory();
$factory($container);
}
}