X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fconfig%2FEtcdConfigTest.php;h=379eebd8a40b9ead6d4b923122ee8e59b580db9f;hb=f6de67738dcc8b25c1343e2b1cb244641f8ede91;hp=7a4d9d9f6fcf5ed596f1d39d175cb32a26c8ea82;hpb=fe4b09380562976aea9f06e59d342fff8d91b026;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/config/EtcdConfigTest.php b/tests/phpunit/includes/config/EtcdConfigTest.php index 7a4d9d9f6f..379eebd8a4 100644 --- a/tests/phpunit/includes/config/EtcdConfigTest.php +++ b/tests/phpunit/includes/config/EtcdConfigTest.php @@ -461,6 +461,26 @@ class EtcdConfigTest extends PHPUnit_Framework_TestCase { false // retry ], ], + '200 OK - Directory with non-array "nodes" key' => [ + 'http' => [ + 'code' => 200, + 'reason' => 'OK', + 'headers' => [], + 'body' => json_encode( [ 'node' => [ 'nodes' => [ + [ + 'key' => '/example/a', + 'dir' => true, + 'nodes' => 'not an array' + ], + ] ] ] ), + 'error' => '', + ], + 'expect' => [ + null, + "Unexpected JSON response in dir 'a'; 'nodes' is not an array.", + false // retry + ], + ], '200 OK - Correctly encoded garbage response' => [ 'http' => [ 'code' => 200,