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

Export_Relation_Schema_test.php « schema « classes « test - github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 573e345c4ba225154f054dce538539e43870c4d3 (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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<?php
/**
 * Tests for PMA_Export_Relation_Schema class
 *
 * @package PhpMyAdmin-test
 */

/*
 * Include to test.
 */
require_once 'libraries/Util.class.php';
require_once 'libraries/relation.lib.php';
require_once 'libraries/url_generating.lib.php';
require_once 'libraries/php-gettext/gettext.inc';
require_once 'libraries/database_interface.inc.php';
require_once 'libraries/plugins/schema/Export_Relation_Schema.class.php';

/**
 * Tests for PMA_Export_Relation_Schema class
 *
 * @package PhpMyAdmin-test
 */
class PMA_Export_Relation_Schema_Test extends PHPUnit_Framework_TestCase
{
    /**
     * @access protected
     */
    protected $object;

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     *
     * @access protected
     * @return void
     */
    protected function setUp()
    {
        $_REQUEST['page_number'] = 33;
        $this->object = new PMA_Export_Relation_Schema('information_schema', null);
    }

    /**
     * Tears down the fixture, for example, closes a network connection.
     * This method is called after a test is executed.
     *
     * @access protected
     * @return void
     */
    protected function tearDown()
    {
        unset($this->object);
    }

    /**
     * Test for setPageNumber
     *
     * @return void
     *
     * @group medium
     */
    public function testSetPageNumbere()
    {
        $this->object->setPageNumber(33);
        $this->assertEquals(
            33,
            $this->object->getPageNumber()
        );
    }

    /**
     * Test for setShowColor
     *
     * @return void
     *
     * @group medium
     */
    public function testSetShowColor()
    {
        $this->object->setShowColor(true);
        $this->assertEquals(
            true,
            $this->object->isShowColor()
        );
        $this->object->setShowColor(false);
        $this->assertEquals(
            false,
            $this->object->isShowColor()
        );
    }

    /**
     * Test for setOrientation
     *
     * @return void
     *
     * @group medium
     */
    public function testSetOrientation()
    {
        $this->object->setOrientation('P');
        $this->assertEquals(
            'P',
            $this->object->getOrientation()
        );
        $this->object->setOrientation('A');
        $this->assertEquals(
            'L',
            $this->object->getOrientation()
        );
    }

    /**
     * Test for setTableDimension
     *
     * @return void
     *
     * @group medium
     */
    public function testSetTableDimension()
    {
        $this->object->setTableDimension(true);
        $this->assertEquals(
            true,
            $this->object->isTableDimension()
        );
        $this->object->setTableDimension(false);
        $this->assertEquals(
            false,
            $this->object->isTableDimension()
        );
    }

    /**
     * Test for setPaper
     *
     * @return void
     *
     * @group medium
     */
    public function testSetPaper()
    {
        $this->object->setPaper('A5');
        $this->assertEquals(
            'A5',
            $this->object->getPaper()
        );
        $this->object->setPaper('A4');
        $this->assertEquals(
            'A4',
            $this->object->getPaper()
        );
    }

    /**
     * Test for setAllTablesSameWidth
     *
     * @return void
     *
     * @group medium
     */
    public function testSetAllTablesSameWidth()
    {
        $this->object->setAllTablesSameWidth(true);
        $this->assertEquals(
            true,
            $this->object->isAllTableSameWidth()
        );
        $this->object->setAllTablesSameWidth(false);
        $this->assertEquals(
            false,
            $this->object->isAllTableSameWidth()
        );
    }

    /**
     * Test for setShowKeys
     *
     * @return void
     *
     * @group medium
     */
    public function testSetShowKeys()
    {
        $this->object->setShowKeys(true);
        $this->assertEquals(
            true,
            $this->object->isShowKeys()
        );
        $this->object->setShowKeys(false);
        $this->assertEquals(
            false,
            $this->object->isShowKeys()
        );
    }
}