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

PublicSectionsTest.php « unit « tests - github.com/HuasoFoundries/phpPgAdmin6.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8fb67fa298a4a01e76f9d1e28e360943888aae56 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?php

/**
 * PHPPgAdmin 6.1.3
 */

/**
 * @internal
 * @coversNothing
 */
class PublicSectionsTest extends \Codeception\Test\Unit
{
    protected static $BASE_PATH;

    protected $_container;

    //const BASE_PATH = self::BASE_PATH;

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

    public function testAlldbView(): void
    {
        $_container = $this->container;

        require self::$BASE_PATH . '/tests/views/alldb.php';
        $controller = alldbFactory($_container);
        self::assertSame($controller->controller_name, 'AlldbController', 'controller name should be AlldbController');
    }

    public function testBrowserView(): void
    {
        $_container = $this->container;

        require self::$BASE_PATH . '/tests/views/browser.php';
        $controller = browserFactory($_container);
        self::assertSame($controller->controller_name, 'BrowserController', 'controller name should be BrowserController');
    }

    public function testDatabaseView(): void
    {
        $_container = $this->container;

        require self::$BASE_PATH . '/tests/views/database.php';
        $controller = databaseFactory($_container);
        self::assertSame($controller->controller_name, 'DatabaseController', 'controller name should be DatabaseController');
    }

    public function testHelpView(): void
    {
        $_container = $this->container;

        require self::$BASE_PATH . '/tests/views/help.php';
        $controller = helpFactory($_container);
        self::assertSame($controller->controller_name, 'HelpController', 'controller name should be HelpController');
    }

    public function testHistoryView(): void
    {
        $_container = $this->container;

        require self::$BASE_PATH . '/tests/views/history.php';
        $controller = historyFactory($_container);
        self::assertSame($controller->controller_name, 'HistoryController', 'controller name should be HistoryController');
    }

    public function testInfoView(): void
    {
        $_container = $this->container;

        require self::$BASE_PATH . '/tests/views/info.php';
        $controller = infoFactory($_container);
        self::assertSame($controller->controller_name, 'InfoController', 'controller name should be InfoController');
    }

    public function testIntroView(): void
    {
        $_container = $this->container;

        require self::$BASE_PATH . '/tests/views/intro.php';
        $controller = introFactory($_container);
        self::assertSame($controller->controller_name, 'IntroController', 'controller name should be IntroController');
    }

    public function testLoginView(): void
    {
        $_container = $this->container;

        require self::$BASE_PATH . '/tests/views/login.php';
        $controller = loginFactory($_container);
        self::assertSame($controller->controller_name, 'LoginController', 'controller name should be LoginController');
    }

    public function testSchemasView(): void
    {
        $_container = $this->container;

        require self::$BASE_PATH . '/tests/views/schemas.php';
        $controller = schemasFactory($_container);
        self::assertSame($controller->controller_name, 'SchemasController', 'controller name should be SchemasController');
    }

    public function testServersView(): void
    {
        $_container = $this->container;

        require self::$BASE_PATH . '/tests/views/servers.php';
        $controller = serversFactory($_container);
        self::assertSame($controller->controller_name, 'ServersController', 'controller name should be ServersController');
    }

    public function testSqlView(): void
    {
        $_container = $this->container;

        require self::$BASE_PATH . '/tests/views/sql.php';
        $controller = sqlFactory($_container);
        self::assertSame($controller->controller_name, 'SqlController', 'controller name should be SqlController');
    }

    public function testSqleditView(): void
    {
        $_container = $this->container;

        require self::$BASE_PATH . '/tests/views/sqledit.php';
        $controller = sqleditFactory($_container);
        self::assertSame($controller->controller_name, 'SqleditController', 'controller name should be SqleditController');
    }

    protected function _before(): void
    {
        $Helper = $this->getModule('\Helper\Unit');
        $this->container = $Helper::getContainer();
        self::$BASE_PATH = self::$BASE_PATH = $this->container->BASE_PATH;
        $this->container->get('misc')->setNoDBConnection(true);
        // Helper
        //\Codeception\Util\Debug::debug('BASE_PATH is ' . \BASE_PATH);
    }
}