aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/container
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-01-18 17:50:11 +0100
committerArthurHoaro <arthur@hoa.ro>2020-01-26 11:34:14 +0100
commit6c50a6ccceecf54850e62c312ab2397b84d89ab4 (patch)
tree3205aa447930eab020ea04bf00082880abec5001 /tests/container
parent1410dce2db310e71b5e683b0871c2f28d8807844 (diff)
downloadShaarli-6c50a6ccceecf54850e62c312ab2397b84d89ab4.tar.gz
Shaarli-6c50a6ccceecf54850e62c312ab2397b84d89ab4.tar.zst
Shaarli-6c50a6ccceecf54850e62c312ab2397b84d89ab4.zip
Render login page through Slim controller
Diffstat (limited to 'tests/container')
-rw-r--r--tests/container/ContainerBuilderTest.php49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/container/ContainerBuilderTest.php b/tests/container/ContainerBuilderTest.php
new file mode 100644
index 00000000..9b97ed6d
--- /dev/null
+++ b/tests/container/ContainerBuilderTest.php
@@ -0,0 +1,49 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Shaarli\Container;
6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Bookmark\BookmarkServiceInterface;
9use Shaarli\Config\ConfigManager;
10use Shaarli\History;
11use Shaarli\Render\PageBuilder;
12use Shaarli\Security\LoginManager;
13use Shaarli\Security\SessionManager;
14
15class ContainerBuilderTest extends TestCase
16{
17 /** @var ConfigManager */
18 protected $conf;
19
20 /** @var SessionManager */
21 protected $sessionManager;
22
23 /** @var LoginManager */
24 protected $loginManager;
25
26 /** @var ContainerBuilder */
27 protected $containerBuilder;
28
29 public function setUp(): void
30 {
31 $this->conf = new ConfigManager('tests/utils/config/configJson');
32 $this->sessionManager = $this->createMock(SessionManager::class);
33 $this->loginManager = $this->createMock(LoginManager::class);
34
35 $this->containerBuilder = new ContainerBuilder($this->conf, $this->sessionManager, $this->loginManager);
36 }
37
38 public function testBuildContainer(): void
39 {
40 $container = $this->containerBuilder->build();
41
42 static::assertInstanceOf(ConfigManager::class, $container->conf);
43 static::assertInstanceOf(SessionManager::class, $container->sessionManager);
44 static::assertInstanceOf(LoginManager::class, $container->loginManager);
45 static::assertInstanceOf(History::class, $container->history);
46 static::assertInstanceOf(BookmarkServiceInterface::class, $container->bookmarkService);
47 static::assertInstanceOf(PageBuilder::class, $container->pageBuilder);
48 }
49}