Skip to content

Commit

Permalink
Merge branch 'feature/tests-stabilize-pear-var' of https://github.com…
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed Sep 24, 2020
2 parents 954a1c6 + 33af771 commit 9a9676f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 1 addition & 4 deletions tests/AllTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,13 @@

namespace PHP_CodeSniffer\Tests;

$GLOBALS['PHP_CODESNIFFER_PEAR'] = false;

if (is_file(__DIR__.'/../autoload.php') === true) {
if ($GLOBALS['PHP_CODESNIFFER_PEAR'] === false) {
include_once 'Core/AllTests.php';
include_once 'Standards/AllSniffs.php';
} else {
include_once 'CodeSniffer/Core/AllTests.php';
include_once 'CodeSniffer/Standards/AllSniffs.php';
include_once 'FileList.php';
$GLOBALS['PHP_CODESNIFFER_PEAR'] = true;
}

// PHPUnit 7 made the TestSuite run() method incompatible with
Expand Down
7 changes: 7 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ class_alias('PHPUnit_TextUI_TestRunner', 'PHPUnit'.'\TextUI\TestRunner');
class_alias('PHPUnit_Framework_TestResult', 'PHPUnit'.'\Framework\TestResult');
}

// Determine whether this is a PEAR install or not.
$GLOBALS['PHP_CODESNIFFER_PEAR'] = false;

if (is_file(__DIR__.'/../autoload.php') === false) {
$GLOBALS['PHP_CODESNIFFER_PEAR'] = true;
}


/**
* A global util function to help print unit test fixing data.
Expand Down

0 comments on commit 9a9676f

Please sign in to comment.