Total Complexity | 8 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
7 | abstract class TestUtils |
||
8 | { |
||
9 | |||
10 | /** |
||
11 | * Perform a test with some specific configuration which should not affect other tests. |
||
12 | * |
||
13 | * @param array $configMap |
||
14 | * @param Callable $testCallback |
||
15 | */ |
||
16 | public static function testWithConfig($configMap, $testCallback) |
||
17 | { |
||
18 | $originalConfigValues = array(); |
||
19 | // Set new config values. |
||
20 | foreach ($configMap as $class => $config) { |
||
21 | foreach ($config as $key => $value) { |
||
22 | $originalConfigValues[$class][$key] = Config::inst()->get($class, $key); |
||
23 | Config::inst()->update($class, $key, $value); |
||
|
|||
24 | } |
||
25 | } |
||
26 | |||
27 | // Perform test with specific configuration. |
||
28 | $testCallback(); |
||
29 | |||
30 | // Restore original config values. |
||
31 | foreach ($originalConfigValues as $class => $config) { |
||
32 | foreach ($config as $key => $value) { |
||
33 | Config::inst()->update($class, $key, $value); |
||
34 | } |
||
35 | } |
||
36 | } |
||
37 | |||
38 | public static function arrayChangeKeyCaseDeep(array $input, $case = null) |
||
46 | } |
||
47 | } |
||
48 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.