From 1e7c98cc90e8bee732b89d588761d03a930cce34 Mon Sep 17 00:00:00 2001 From: Vlad Veselov Date: Sat, 25 Feb 2017 12:12:38 +0200 Subject: [PATCH] Fix PHPCS tool wrapper to support builtin standards --- .../TestFramework/CodingStandard/Tool/CodeSniffer.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CodeSniffer.php b/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CodeSniffer.php index f1ce11e57acf8..d0b9868796be8 100644 --- a/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CodeSniffer.php +++ b/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CodeSniffer.php @@ -51,7 +51,10 @@ class CodeSniffer implements ToolInterface, ExtensionInterface */ public function __construct($rulesetDir, $reportFile, Wrapper $wrapper) { - $this->rulesetDir = file_exists($rulesetDir) ? $rulesetDir : realpath(__DIR__ . '/../../../../' . $rulesetDir); + $this->rulesetDir = $rulesetDir; + if (!file_exists($rulesetDir) && file_exists($fullPath = realpath(__DIR__ . '/../../../../' . $rulesetDir))) { + $this->rulesetDir = $fullPath; + } $this->reportFile = $reportFile; $this->wrapper = $wrapper; }