Test Failed
Branch develop (db5506)
by Felipe
03:46
created

AdminTest::testAdminVacuumAna()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 11
nc 1
nop 0
dl 0
loc 17
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * Function area     : Database.
4
 * Sub Function area : Admin.
5
 * 
6
 * @author     Augmentum SpikeSource Team
7
 * @copyright  Copyright (c) 2005 by Augmentum, Inc.
8
 */
9
10
// Import the precondition class.
11
if (is_dir('../Public'))
12
{
13
    require_once('../Public/SetPrecondition.php');
14
} 
15
16
/**
17
 * This class is to test the Admin about PostgreSql implementation.
18
 */
19
20
class AdminTest extends PreconditionSet
21
{
22
    /**
23
     * Set up the preconditon.
24
     */
25
    function setUp()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
26
    {
27
        global $webUrl;
28
        global $SUPER_USER_NAME;
29
        global $SUPER_USER_PASSWORD;
30
        $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD,
31
                     "$webUrl/login.php");
32
33
        return TRUE;
34
    }
35
36
37
    /**
38
     * Release the relational resource.
39
     */
40
    function tearDown()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
41
    {
42
        // Logout this system.
43
        $this->logout();
44
45
        return TRUE;
46
    }
47
48
49
    /**
50
     * TestCaseId: DAV001
51
     * This test is used to test the admin about Vacuum and full.
52
     */
53
    function testAdminVacuumAna()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
54
    {
55
        global $webUrl, $lang, $SERVER, $DATABASE;
56
        
57
        // Locate the list page of admin.
58
		$this->assertTrue($this->get("$webUrl/database.php",
59
			array('database' => $DATABASE,
60
				'subject' => 'database',
61
				'action' => 'admin',
62
				'server' => $SERVER))
63
		);
64
        $this->assertTrue($this->setField('vacuum_analyze', TRUE));
65
        $this->assertTrue($this->setField('vacuum_full', TRUE));
66
        $this->assertTrue($this->clickSubmit($lang['strvacuum']));
67
        $this->assertWantedText($lang['strvacuumgood']);
68
69
        return TRUE;
70
    }
71
72
73
    /**
74
     * TestCaseId: DCS002
75
     * This test is used to test the admin about freeze.
76
     */
77
    function testAdminFreeze()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
78
    {
79
        global $webUrl, $lang, $SERVER, $DATABASE;
80
        
81
        // Locate the list page of admin.
82
		$this->assertTrue($this->get("$webUrl/database.php",
83
			array('database' => $DATABASE,
84
				'subject' => 'database',
85
				'action' => 'admin',
86
				'server' => $SERVER))
87
		);
88
        $this->assertTrue($this->setField('vacuum_freeze', TRUE));
89
        $this->assertTrue($this->clickSubmit($lang['strvacuum']));
90
        $this->assertWantedText($lang['strvacuumgood']);
91
92
        return TRUE;
93
    }
94
95
96
    /**
97
     * TestCaseId: DCS003
98
     * This test is used to test the admin about Analyze.
99
     */
100
    function testAdminAnalyze()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
101
    {
102
        global $webUrl, $lang, $SERVER, $DATABASE;
103
        
104
        // Locate the list page of admin.
105
		$this->assertTrue($this->get("$webUrl/database.php",
106
			array('database' => $DATABASE,
107
				'subject' => 'database',
108
				'action' => 'admin',
109
				'server' => $SERVER))
110
		);
111
        $this->assertTrue($this->clickSubmit($lang['stranalyze']));
112
        $this->assertWantedText($lang['stranalyzegood']);
113
114
        return TRUE;
115
    }
116
117
118
    /**
119
     * TestCaseId: DCS004
120
     * This test is used to test the admin about Cluster.
121
     */
122
    function testAdminCluster()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
123
    {
124
        global $webUrl, $lang, $SERVER, $DATABASE;
125
        
126
        // Locate the list page of admin.
127
		$this->assertTrue($this->get("$webUrl/database.php", array(
128
				'server' => $SERVER,
129
				'database' => $DATABASE,
130
				'subject' => 'database',
131
				'action' => 'admin'))
132
		);
133
        $this->assertTrue($this->clickSubmit($lang['strcluster']));
134
        $this->assertWantedText($lang['strclusteredgood']);
135
136
        return TRUE;
137
    }
138
139
140
    /**
141
     * TestCaseId: DCS005
142
     * This test is used to test the admin about Reindex.
143
     */
144
    function testAdminReindex()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
145
    {
146
        global $webUrl, $lang, $SERVER, $DATABASE;
147
148
        // Locate the list page of admin.
149
		$this->assertTrue($this->get("$webUrl/database.php", array(
150
				'database' => $DATABASE,
151
				'subject' => 'database',
152
				'action' => 'admin',
153
				'server' => $SERVER))
154
		);
155
        $this->assertTrue($this->setField('reindex_force', TRUE));
156
        $this->assertTrue($this->clickSubmit($lang['strreindex']));
157
        $this->assertWantedText($lang['strreindexgood']);
158
159
        return TRUE;
160
    }
161
}
162
163
?>
0 ignored issues
show
Best Practice introduced by
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
164