]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Don't throw an exception if no configuration is set for linter tests
authorJoshua Spence <josh@joshuaspence.com>
Fri, 20 Jun 2014 21:15:38 +0000 (07:15 +1000)
committerJoshua Spence <josh@joshuaspence.com>
Fri, 20 Jun 2014 21:15:38 +0000 (07:15 +1000)
Summary: This was broken in D9641. If `$config` is not set, then a `PhutilJSONParserException` will be thrown. The expected behaviour is that it is okay to not explicitly set any configuration.

Test Plan: Ran `arc unit`.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9643

src/lint/linter/__tests__/ArcanistLinterTestCase.php

index 43ff70a9dbdece23567cb1591c424e52b852fdd5..48eb173ae46793088d724b730b968037cc0a092e 100644 (file)
@@ -38,7 +38,11 @@ abstract class ArcanistLinterTestCase extends ArcanistPhutilTestCase {
 
     $basename = basename($file);
 
-    $config = phutil_json_decode($config);
+    if ($config) {
+      $config = phutil_json_decode($config);
+    } else {
+      $config = array();
+    }
     PhutilTypeSpec::checkMap(
       $config,
       array(