diff --git a/CodeSniffer/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.php b/CodeSniffer/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.php index a22e3c2bea..95d572f82e 100755 --- a/CodeSniffer/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.php +++ b/CodeSniffer/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.php @@ -33,6 +33,19 @@ class Zend_Tests_Debug_CodeAnalyzerUnitTest extends AbstractSniffUnitTest { + /** + * Should this test be skipped for some reason. + * + * @return void + */ + protected function shouldSkipTest() + { + $analyzerPath = PHP_CodeSniffer::getConfigData('zend_ca_path'); + return (is_null($analyzerPath)); + + }//end shouldSkipTest() + + /** * Returns the lines where errors should occur. * diff --git a/tests/Standards/AbstractSniffUnitTest.php b/tests/Standards/AbstractSniffUnitTest.php index b84a0a75fd..f5707d033b 100755 --- a/tests/Standards/AbstractSniffUnitTest.php +++ b/tests/Standards/AbstractSniffUnitTest.php @@ -57,6 +57,18 @@ protected function setUp() }//end setUp() + /** + * Should this test be skipped for some reason. + * + * @return void + */ + protected function shouldSkipTest() + { + return false; + + }//end shouldSkipTest() + + /** * Tests the extending classes Sniff class. * @@ -65,6 +77,11 @@ protected function setUp() */ protected final function runTest() { + // Skip this test if we can't run in this environment. + if ($this->shouldSkipTest() === true) { + $this->markTestSkipped(); + } + // The basis for determining file locations. $basename = substr(get_class($this), 0, -8);