Merge "Title: Refactor JS/CSS page handling to be more sane"
[lhc/web/wiklou.git] / tests / phpunit / includes / config / EtcdConfigTest.php
index 7a4d9d9..c833934 100644 (file)
@@ -2,7 +2,7 @@
 
 use Wikimedia\TestingAccessWrapper;
 
-class EtcdConfigTest extends PHPUnit_Framework_TestCase {
+class EtcdConfigTest extends PHPUnit\Framework\TestCase {
 
        use MediaWikiCoversValidator;
 
@@ -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,