Passed
Pull Request — develop (#92)
by Felipe
04:56
created

OpClassTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 52
rs 10
c 0
b 0
f 0
wmc 3
1
<?php
2
 /**
3
  * Function area:       Schemas
4
  * Subfunction area:    Op Classes.
5
  * @author     Augmentum SpikeSource Team 
6
  * @copyright  2005 by Augmentum, Inc.
7
  */
8
 
9
 
10
// Import the precondition class.
11
if(is_dir('../Public')) {
12
    require_once('../Public/SetPrecondition.php');
13
}
14
15
16
/**
17
 * A test case suite for testing OP Class feature in phpPgAdmin, including
18
 * cases for browsing op class.
19
 */
20
class OpClassTest extends PreconditionSet
21
{
22
    /**
23
     * Set up the precondition. 
24
     */
25
    function setUp()
26
    {
27
        global $webUrl;
28
        global $SUPER_USER_NAME;
29
        global $SUPER_USER_PASSWORD;
30
        
31
        // Login the system.
32
        $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, 
33
                     "$webUrl/login.php");  
34
        
35
        return TRUE;          
36
    }
37
    
38
    
39
    /**
40
     * Clean up all the result. 
41
     */
42
    function tearDown()
43
    {
44
        // Logout from the system.
45
        $this->logout(); 
46
        
47
        return TRUE;
48
    }
49
    
50
    
51
    /**
52
     * TestCaseID: HBC01
53
     * Browse all the op classes.
54
     */
55
    function testBrowseOpClass()
56
    {
57
        global $webUrl;
58
        global $lang, $SERVER, $DATABASE;
59
        
60
        // Turn to schema "pg_catalog" page.
61
		$this->assertTrue($this->get("$webUrl/opclasses.php", array(
62
			            'server' => $SERVER,
63
						'database' => $DATABASE,
64
						'schema' => 'pg_catalog',
65
						'subject' => 'schema'))
66
					);
67
        
68
        // Verify whether all the op classes are displayed.
69
        $this->assertTrue($this->assertWantedText($lang['straccessmethod']));
70
        
71
        return TRUE;
72
    } 
73
}    
74
75
?>
76