mirror of
https://gh.wpcy.net/https://github.com/WordPress/WordPress-Coding-Standards.git
synced 2026-04-26 00:02:20 +08:00
The duplicates of the PHPCS 2.x test controller files can now be removed. We also no longer need to load our `PHPCSAliases` file, not even for the autoloading of the abstract classes as PHPCS 3.1.0+handles this without problem. For PHPUnit 7.x support, PHPCS does need a bootstrap file, but that is included with PHPCS, so all we need to do is reference that file in the command send to PHPUnit.
14 lines
492 B
Bash
Executable file
14 lines
492 B
Bash
Executable file
#!/bin/bash
|
|
set -e
|
|
cd "$(git rev-parse --show-toplevel)"
|
|
|
|
phpcs_root="$(dirname $(dirname $(which phpcs)))"
|
|
|
|
if [ -z "$phpcs_root" ] || [ ! -d "$phpcs_root" ] || [ ! -e "$phpcs_root/tests/AllTests.php" ]; then
|
|
echo "Unable to locate phpcs on path to locate the root of the PHP_CodeSniffer project" 1>&2
|
|
exit 1
|
|
fi
|
|
|
|
find . \( -name '*.php' \) -exec php -lf {} \;
|
|
|
|
PHPCS_DIR=$phpcs_root phpunit --filter WordPress --bootstrap="$phpcs_root/tests/bootstrap.php" "$phpcs_root/tests/AllTests.php"
|