summaryrefslogtreecommitdiff
path: root/tests/Unit/ApplicationTest.php
blob: 77429f445dea8d5e6324a86ed54bc33640079aa4 (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
<?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, Container::getInstance());
    }
}