summaryrefslogtreecommitdiff
path: root/tests/Unit/ApplicationTest.php
blob: 53fe3109f17a3d0e2e2a993db670057451b70f0b (plain)
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
<?php

namespace Engelsystem\Test\Config;

use Engelsystem\Application;
use Engelsystem\Container\Container;
use PHPUnit\Framework\TestCase;
use Psr\Container\ContainerInterface;

class ApplicationTest extends TestCase
{
    /**
     * @covers       \Engelsystem\Application::__construct
     * @covers       \Engelsystem\Application::registerBaseBindings
     */
    public function testConstructor()
    {
        $app = new Application();

        $this->assertInstanceOf(Container::class, $app);
        $this->assertInstanceOf(ContainerInterface::class, $app);
        $this->assertSame($app, $app->get('app'));
        $this->assertSame($app, $app->get('container'));
        $this->assertSame($app, $app->get(Container::class));
        $this->assertSame($app, $app->get(Application::class));
        $this->assertSame($app, $app->get(ContainerInterface::class));
        $this->assertSame($app, Application::getInstance());
        $this->assertSame($app, Container::getInstance());
    }
}