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

CastsTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 53
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A tearDown() 0 6 1
A setUp() 0 9 1
A testLanguage() 0 18 1
1
<?php
2
/**
3
 * Function area     : Database.
4
 * Sub Function area : Casts.
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 Casts displayed list.
18
 */
19
class CastsTest 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 $SUPER_USER_NAME;
28
        global $SUPER_USER_PASSWORD;
29
        $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD,
30
                     "$webUrl/login.php");
31
32
        return TRUE;
33
    }
34
35
36
    /**
37
     * Release the relational resource.
38
     */
39
    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...
40
    {
41
        // Logout this system.
42
        $this->logout();
43
44
        return TRUE;
45
    }
46
47
48
    /**
49
     * TestCaseId: DLU001
50
     * This test is used to test Casts Displayed page.
51
     *
52
     * Note: It's strange here, because it only display one sentecse.
53
     */
54
    function testLanguage()
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...
55
    {
56
        global $webUrl;
57
        global $lang, $SERVER, $DATABASE;
58
59
        // Locate the list page of language.
60
		$this->assertTrue($this->get("$webUrl/casts.php", array(
61
			            'server' => $SERVER,
62
						'database' => $DATABASE,
63
						'subject' => 'database'))
64
					);
65
66
        $this->assertWantedText($lang['strsourcetype']);
67
        $this->assertWantedText($lang['strtargettype']);
68
        $this->assertWantedText($lang['strimplicit']);
69
        
70
71
        return TRUE;
72
    }
73
}
74
75
?>
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...
76