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

ConversionTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Importance

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