File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 3
3
# Run the unit tests, if they exist
4
4
if [ -f " phpunit.xml" ] || [ -f " phpunit.xml.dist" ] || [ -f " .phpunit.xml" ] || [ -f " .phpunit.xml.dist" ]
5
5
then
6
+ PHPUNIT_VERSION=$( vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp ' \b[0-9]+\.[0-9]+' )
7
+ EXTRA_ARGS=" "
8
+
9
+ if [ " ${PHPUNIT_VERSION# 11} " != " $PHPUNIT_VERSION " ] || [ " ${PHPUNIT_VERSION# 10} " != " $PHPUNIT_VERSION " ]; then
10
+ EXTRA_ARGS=" --display-warnings --fail-on-warning --display-notices --fail-on-notice --display-deprecations --fail-on-deprecation"
11
+ fi
12
+
6
13
if [ -f " ./vendor/wp-cli/wp-cli-tests/tests/bootstrap.php" ]; then
7
- vendor/bin/phpunit --color=always " $@ " --bootstrap ./vendor/wp-cli/wp-cli-tests/tests/bootstrap.php
14
+ vendor/bin/phpunit --color=always " $@ " $EXTRA_ARGS --bootstrap ./vendor/wp-cli/wp-cli-tests/tests/bootstrap.php
8
15
else
9
- vendor/bin/phpunit --color=always " $@ "
16
+ vendor/bin/phpunit --color=always " $@ " $EXTRA_ARGS
10
17
fi
11
18
fi
You can’t perform that action at this time.
0 commit comments