Passed
Pull Request — develop (#92)
by Felipe
06:21
created

ConversionTest::tearDown()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
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()
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 $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()
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 from the system.
43
        $this->logout(); 
44
        
45
        return TRUE;
46
    }
47
    
48
    /**
49
     * TestCaseID: HBC01
50
     * Browse the conversions.
51
     */
52
    function testBrowseConversion()
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...
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
?>
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...
77