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

ViewTest.php « unit « tests - github.com/HuasoFoundries/phpPgAdmin6.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f0a2b512868d9c814393a85d0e58e75fa9e32de5 (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
142
143
144
145
146
147
<?php

/**
 * PHPPgAdmin6
 */

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

    protected ?\PHPPgAdmin\ContainerUtils $container;

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

    // tests

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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