Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ContainerTest.php « unit « tests - github.com/HuasoFoundries/phpPgAdmin6.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f1b6829f3bf4d92fd03944ec1691bd9c895c6960 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php

/**
 * PHPPgAdmin6
 */

/**
 * PHPPgAdmin vv6.0.0-RC8-16-g13de173f.
 *
 * @internal
 * @coversNothing
 */
class ContainerTest extends \Codeception\Test\Unit
{
    protected static $BASE_PATH;

    /**
     * @var \UnitTester
     */
    protected $tester;

    /**
     * Undocumented variable.
     *
     * @var null|\PHPPgAdmin\ContainerUtils
     */
    protected $container;

    public function testContainerValidity(): void
    {
        self::assertTrue(
            $this->container instanceof \Psr\Container\ContainerInterface,
            '$container must be an instance of \Psr\Container\ContainerInterface'
        );
    }

    public function testContainerUtils(): void
    {
        self::assertTrue(
            $this->container instanceof \PHPPgAdmin\ContainerUtils,
            '$container->utils must be an instance of PHPPgAdmin\ContainerUtils'
        );
    }

    public function testContainermisc(): void
    {
        self::assertTrue(
            $this->container->misc instanceof \PHPPgAdmin\Misc,
            '$container->misc must be an instance of \PHPPgAdmin\Misc'
        );
    }

    public function testContainerview(): void
    {
        self::assertTrue(
            $this->container->view instanceof \Slim\Views\Twig,
            '$container->view must be an instance of \Slim\Views\Twig'
        );
    }

    protected function _before(): void
    {
        $this->container = containerInstance();
        self::$BASE_PATH = $this->container->BASE_PATH;
        $this->container->get('misc')->setNoDBConnection(true);
    }
}