Skip to content

Commit 2e141c1

Browse files
committed
Test scripts: add ability to pass additional command line arguments
1 parent 03697e0 commit 2e141c1

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

bin/unit-tests

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,11 @@
99
#
1010
# ./bin/unit-tests
1111
#
12+
# The script allows to pass additional PHPUnit CLI arguments.
13+
# For instance, if you only want to run the tests for one particular sniff,
14+
# use the following, replacing "SniffName" with the name of the target sniff:
15+
#
16+
# ./bin/unit-tests --filter SniffName
17+
#
1218

13-
"$(pwd)/vendor/bin/phpunit" --filter WordPressVIPMinimum "$(pwd)/vendor/squizlabs/php_codesniffer/tests/AllTests.php" --no-coverage
19+
"$(pwd)/vendor/bin/phpunit" --filter WordPressVIPMinimum "$(pwd)/vendor/squizlabs/php_codesniffer/tests/AllTests.php" --no-coverage $@

bin/unit-tests-coverage

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,12 @@
88
#
99
# ./bin/unit-tests-coverage
1010
#
11+
# The script allows to pass additional PHPUnit CLI arguments.
12+
# For instance, if you only want to run the tests with code coverage for one
13+
# particular sniff, use the following, replacing "SniffName" with the name
14+
# of the target sniff:
15+
#
16+
# ./bin/unit-tests-coverage --filter SniffName
17+
#
1118

12-
"$(pwd)/vendor/bin/phpunit" --filter WordPressVIPMinimum "$(pwd)/vendor/squizlabs/php_codesniffer/tests/AllTests.php"
19+
"$(pwd)/vendor/bin/phpunit" --filter WordPressVIPMinimum "$(pwd)/vendor/squizlabs/php_codesniffer/tests/AllTests.php" $@

0 commit comments

Comments
 (0)