Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,12 @@ jobs:

- uses: "ramsey/composer-install@v4"

# load PHPStan Turbo from php.ini, so every PHP process of the test suite has it
-
name: Load PHPStan Turbo
run: |
EXTENSION=$(php -r 'require "vendor/autoload.php"; echo PHPStan\Turbo\TurboExtensionSelector::findExtensionForWorkers();')
echo "extension=$EXTENSION" | sudo tee "$(php -r 'echo PHP_CONFIG_FILE_SCAN_DIR;')/99-phpstan-turbo.ini"
php -r 'exit(extension_loaded("phpstan_turbo") ? 0 : 1);'

- run: vendor/bin/fastunit tests rules-tests utils/phpstan/tests
11 changes: 11 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

declare(strict_types=1);

use PHPStan\PharAutoloader;
use PHPStan\Turbo\TurboExtensionEnabler;

// PHPStan Turbo replaces php-parser classes, so it is activated before preload.php declares them
if (extension_loaded('phpstan_turbo')) {
require_once __DIR__ . '/../vendor/autoload.php';
TurboExtensionEnabler::activateIfCompatible(
dirname((string) new ReflectionClass(PharAutoloader::class)->getFileName()) . '/phpstan.phar'
);
}

// make local php-parser a priority to avoid conflict
require_once __DIR__ . '/../preload.php';
require_once __DIR__ . '/../vendor/autoload.php';
Expand Down
Loading