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

InfoTest   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 115
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 115
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A testListParentTableInfo() 0 15 1
A setUp() 0 11 1
A tearDown() 0 4 1
A testListChildrenTableInfo() 0 15 1
A testShowForeignKeyProperties() 0 19 1
A testListForeignTableInfo() 0 15 1
1
<?php
2
 /**
3
  * Function area:       Table
4
  * Subfunction area:    Info
5
  * @author     Augmentum SpikeSource Team 
6
  * @copyright  2005 by Augmentum, Inc.
7
  */
8
9
// Import the precondition class.
10
if(is_dir('../Public')) 
11
{
12
    require_once('../Public/SetPrecondition.php');
13
}
14
15
16
/**
17
 * A test case suite for testing INFO feature in phpPgAdmin
18
 */
19
class InfoTest extends PreconditionSet{
20
    
21
    /**
22
     * Set up the preconditon. 
23
     */
24
    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...
25
    {
26
        global $webUrl;
27
        global $lang;
28
        global $POWER_USER_NAME;
29
        global $POWER_USER_PASSWORD;
30
        
31
        $this->login($POWER_USER_NAME, $POWER_USER_PASSWORD, 
32
                     "$webUrl/login.php");
33
        
34
        return TRUE;
35
    }
36
    
37
    /**
38
     * Clean up all the result. 
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
        $this->logout(); 
42
        
43
        return TRUE;
44
    }    
45
    
46
    /**
47
     * TestCaseID: TSI01
48
     * List the performance info of the parent table -- student
49
     */ 
50
    function testListParentTableInfo()
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...
51
    {
52
        global $webUrl;
53
        global $lang, $SERVER, $DATABASE;
54
        
55
        // Go to the Rules page
56
		$this->assertTrue($this->get("$webUrl/info.php", array(
57
			            'server' => $SERVER,
58
						'database' => $DATABASE,
59
						'schema' => 'public',
60
						'table' => 'student',
61
						'subject' => 'table'))
62
					);
63
        
64
        return TRUE;            
65
    }
66
    
67
    
68
    /**
69
     * TestCaseID: TSI02
70
     * List the performance info of the children table -- college_student
71
     */ 
72
    function testListChildrenTableInfo()
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...
73
    {
74
        global $webUrl;
75
        global $lang, $SERVER, $DATABASE;
76
        
77
        // Go to the Rules page
78
		$this->assertTrue($this->get("$webUrl/info.php", array(
79
			            'server' => $SERVER,
80
						'database' => $DATABASE,
81
						'schema' => 'public',
82
						'table' => 'college_student',
83
						'subject' => 'table'))
84
					); 
85
        
86
        return TRUE;          
87
    }
88
    
89
    
90
    /**
91
     * TestCaseID: TSI03
92
     * List the performance info of the foreign table -- department
93
     */ 
94
    function testListForeignTableInfo()
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...
95
    {
96
        global $webUrl;
97
        global $lang, $SERVER, $DATABASE;
98
        
99
        // Go to the Rules page
100
		$this->assertTrue($this->get("$webUrl/info.php", array(
101
			            'server' => $SERVER,
102
						'database' => $DATABASE,
103
						'schema' => 'public',
104
						'table' => 'department',
105
						'subject' => 'table'))
106
					);
107
        
108
        return TRUE;
109
    }
110
111
    /**
112
     * TestCaseID: TSP01
113
     * Show the properties of the foreign key constraint
114
     */ 
115
    function testShowForeignKeyProperties()
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...
116
    {
117
        global $webUrl;
118
        global $lang, $SERVER, $DATABASE;
119
        
120
        // Go to the Rules page
121
		$this->assertTrue($this->get("$webUrl/info.php?", array(
122
            'server' => $SERVER,
123
			'database' => $DATABASE,
124
			'schema' => 'public',
125
			'table' => 'department',
126
			'subject' => 'table'))
127
		);
128
             
129
        $this->assertTrue($this->clickLink($lang['strproperties']));
130
        $this->assertWantedText('FOREIGN KEY (dep_id) REFERENCES department(id) ' . 
131
                                'ON UPDATE RESTRICT ON DELETE RESTRICT'); 
132
        
133
        return TRUE;         
134
    }    
135
}
136
?>
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...
137