Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
22 | public function testWarning() |
||
23 | { |
||
24 | // Deliberately low threshold |
||
25 | Config::inst()->update('DebugBar', 'warn_request_time_seconds', '0.00001'); |
||
26 | $result = $this->collector->getWidgets(); |
||
27 | |||
28 | $this->assertSame('danger', $result['time']['warn']); |
||
29 | $this->assertSame('0.00001', $result['time']['warn_threshold_seconds']); |
||
30 | |||
31 | // Deliberately high threshold and low ratio |
||
32 | Config::inst()->update('DebugBar', 'warn_request_time_seconds', '100'); |
||
33 | Config::inst()->update('DebugBar', 'warn_warning_ratio', '0.000000001'); |
||
34 | $result = $this->collector->getWidgets(); |
||
35 | |||
36 | $this->assertSame('warning', $result['time']['warn']); |
||
37 | } |
||
38 | |||
46 |
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.