From a428f22cbf0702581e6220399b9c6f50228a73da Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Sat, 21 Jun 2014 07:15:38 +1000 Subject: [PATCH] Don't throw an exception if no configuration is set for linter tests 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lint/linter/__tests__/ArcanistLinterTestCase.php b/src/lint/linter/__tests__/ArcanistLinterTestCase.php index 43ff70a9..48eb173a 100644 --- a/src/lint/linter/__tests__/ArcanistLinterTestCase.php +++ b/src/lint/linter/__tests__/ArcanistLinterTestCase.php @@ -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( -- 2.43.0