Skip to content

Commit 9a9676f

Browse files
committed
Merge branch 'feature/tests-stabilize-pear-var' of https://github.com/jrfnl/PHP_CodeSniffer
2 parents 954a1c6 + 33af771 commit 9a9676f

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

tests/AllTests.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,13 @@
99

1010
namespace PHP_CodeSniffer\Tests;
1111

12-
$GLOBALS['PHP_CODESNIFFER_PEAR'] = false;
13-
14-
if (is_file(__DIR__.'/../autoload.php') === true) {
12+
if ($GLOBALS['PHP_CODESNIFFER_PEAR'] === false) {
1513
include_once 'Core/AllTests.php';
1614
include_once 'Standards/AllSniffs.php';
1715
} else {
1816
include_once 'CodeSniffer/Core/AllTests.php';
1917
include_once 'CodeSniffer/Standards/AllSniffs.php';
2018
include_once 'FileList.php';
21-
$GLOBALS['PHP_CODESNIFFER_PEAR'] = true;
2219
}
2320

2421
// PHPUnit 7 made the TestSuite run() method incompatible with

tests/bootstrap.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ class_alias('PHPUnit_TextUI_TestRunner', 'PHPUnit'.'\TextUI\TestRunner');
4444
class_alias('PHPUnit_Framework_TestResult', 'PHPUnit'.'\Framework\TestResult');
4545
}
4646

47+
// Determine whether this is a PEAR install or not.
48+
$GLOBALS['PHP_CODESNIFFER_PEAR'] = false;
49+
50+
if (is_file(__DIR__.'/../autoload.php') === false) {
51+
$GLOBALS['PHP_CODESNIFFER_PEAR'] = true;
52+
}
53+
4754

4855
/**
4956
* A global util function to help print unit test fixing data.

0 commit comments

Comments
 (0)