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

TablesAndViewsTest.php « unit « tests - github.com/HuasoFoundries/phpPgAdmin6.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 050be021e6c1ed4e1cd4d657555c1e7bb61d5c8e (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
<?php

/**
 * PHPPgAdmin 6.1.3
 */

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

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

    protected ?\PHPPgAdmin\ContainerUtils $container;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    protected function _after(): void
    {
    }
}