These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace SMW\Test; |
||
4 | |||
5 | /** |
||
6 | * Tests for global constants being loaded |
||
7 | * |
||
8 | * @since 1.9 |
||
9 | * |
||
10 | * @file |
||
11 | * |
||
12 | * @licence GNU GPL v2+ |
||
13 | * @author mwjames |
||
14 | */ |
||
15 | |||
16 | /** |
||
17 | * Tests for global constants being loaded |
||
18 | * |
||
19 | * |
||
20 | * @group SMW |
||
21 | * @group SMWExtension |
||
22 | */ |
||
23 | class DefinesTest extends SemanticMediaWikiTestCase { |
||
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
24 | |||
25 | /** |
||
26 | * Returns the name of the class to be tested |
||
27 | * |
||
28 | * @return string|boolean |
||
29 | */ |
||
30 | public function getClass() { |
||
31 | return false; |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * Provides sample of constants to be tested |
||
36 | * |
||
37 | * @return array |
||
38 | */ |
||
39 | public function getConstantsDataProvider() { |
||
40 | return array( |
||
41 | array( SMW_HEADERS_SHOW, 2 ), |
||
42 | array( SMW_HEADERS_PLAIN, 1 ), |
||
43 | array( SMW_HEADERS_HIDE, 0 ), |
||
44 | array( SMW_OUTPUT_HTML, 1 ), |
||
45 | array( SMW_OUTPUT_WIKI, 2 ), |
||
46 | array( SMW_OUTPUT_FILE, 3 ), |
||
47 | array( SMW_FACTBOX_HIDDEN, 1 ), |
||
48 | array( SMW_FACTBOX_SPECIAL, 2 ), |
||
49 | array( SMW_FACTBOX_NONEMPTY, 3 ), |
||
50 | array( SMW_FACTBOX_SHOWN, 5 ), |
||
51 | ); |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * Test if constants are accessible |
||
56 | * @dataProvider getConstantsDataProvider |
||
57 | * |
||
58 | * @param $constant |
||
59 | * @param $expected |
||
60 | */ |
||
61 | public function testConstants( $constant, $expected ) { |
||
62 | $this->assertEquals( $expected, $constant ); |
||
63 | } |
||
64 | } |
||
65 |