1 | <?php |
||
8 | class DebugBarTest extends SapphireTest |
||
|
|||
9 | { |
||
10 | public function setUp() |
||
17 | |||
18 | public function tearDown() |
||
24 | |||
25 | public function testInitIsWorking() |
||
40 | |||
41 | public function testLHelper() |
||
60 | |||
61 | public function testDHelper() |
||
78 | |||
79 | /** |
||
80 | * @param callable $context |
||
81 | * @param string $expected |
||
82 | * @dataProvider whyDisabledProvider |
||
83 | */ |
||
84 | public function testWhyDisabled($context, $expected) |
||
89 | |||
90 | /** |
||
91 | * @return array[] |
||
92 | */ |
||
93 | public function whyDisabledProvider() |
||
94 | { |
||
95 | return array( |
||
96 | array( |
||
97 | function () { |
||
98 | Director::set_environment_type('live'); |
||
99 | }, |
||
100 | 'Not in dev mode' |
||
101 | ), |
||
102 | array( |
||
103 | function () { |
||
104 | Config::inst()->update('DebugBar', 'disabled', true); |
||
105 | }, |
||
106 | 'Disabled by a constant or configuration' |
||
107 | ), |
||
108 | array( |
||
109 | function () { |
||
110 | // no-op |
||
111 | }, |
||
112 | 'In CLI mode' |
||
113 | ) |
||
114 | ); |
||
115 | } |
||
116 | |||
117 | public function testNotLocalIp() |
||
134 | |||
135 | /** |
||
136 | * For the database collector to be able to push messages to the message collector, it must be loaded |
||
137 | * before the message collector. This test ensures that won't accidentally change in future. |
||
138 | */ |
||
139 | public function testMessageCollectorIsLoadedAfterDatabaseCollector() |
||
154 | } |
||
155 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.