Compare commits

..

4 Commits

Author SHA1 Message Date
Simon Wisselink 9e443fdacd Fix regex matching for slightly different error message for php7.1 2022-11-24 09:28:59 +01:00
Simon Wisselink 3e82c271d4 Removed 2 tests that produce inconsistent results between PHP7.x versions. 2022-11-24 09:20:14 +01:00
Simon Wisselink dad8005b64 Treat undefined vars and array access of a null or false variables
equivalent across all supported PHP versions
2022-11-24 00:35:06 +01:00
Simon Wisselink dee0c3ffd4 Added test to see what changed exactly 2022-11-23 23:56:08 +01:00
4 changed files with 54 additions and 18 deletions
+1
View File
@@ -7,6 +7,7 @@ services:
volumes:
- .:/app
working_dir: /app
entrypoint: sh ./run-tests.sh
php71:
extends:
service: base
@@ -66,8 +66,9 @@ class Smarty_Internal_ErrorHandler
*/
public function handleError($errno, $errstr, $errfile, $errline, $errcontext = [])
{
if ($this->allowUndefinedVars && preg_match(
'/^(Attempt to read property ".+?" on null|Trying to get property (\'.+?\' )?of non-object)/',
'/^(Attempt to read property "value" on null|Trying to get property (\'value\' )?of non-object)/',
$errstr
)) {
return; // suppresses this error
+41 -10
View File
@@ -1,13 +1,44 @@
#!/bin/bash
Help()
{
# Display Help
echo "Runs PHPUnit tests for all PHP versions supported by this version of Smarty."
echo
echo "Syntax: $0 [-e|h]"
echo "options:"
echo "e Exclude a group of unit tests, e.g. -e 'slow'"
echo "h Print this Help."
echo
}
Exclude=""
# Get the options
while getopts ":he:" option; do
case $option in
e) # Exclude
echo $OPTARG
Exclude=$OPTARG;;
h) # display Help
Help
exit;;
\?) # Invalid option
echo "Error: Invalid option"
exit;;
esac
done
if [ -z $Exclude ];
then
Entrypoint="./run-tests.sh"
else
Entrypoint="./run-tests.sh $Exclude"
fi
# Runs tests for all supported PHP versions
# Usage examples:
# - ./run-tests-for-all-php-versions.sh --group 20221124
# - ./run-tests-for-all-php-versions.sh --exclude-group slow
docker-compose run php71 ./run-tests.sh $@ && \
docker-compose run php72 ./run-tests.sh $@ && \
docker-compose run php73 ./run-tests.sh $@ && \
docker-compose run php74 ./run-tests.sh $@ && \
docker-compose run php80 ./run-tests.sh $@ && \
docker-compose run php81 ./run-tests.sh $@
docker-compose run --entrypoint "$Entrypoint" php71 && \
docker-compose run --entrypoint "$Entrypoint" php72 && \
docker-compose run --entrypoint "$Entrypoint" php73 && \
docker-compose run --entrypoint "$Entrypoint" php74 && \
docker-compose run --entrypoint "$Entrypoint" php80 && \
docker-compose run --entrypoint "$Entrypoint" php81
+10 -7
View File
@@ -1,10 +1,13 @@
#!/bin/sh
composer update
# Runs composer update, echoes php version and runs PHPUnit
# Usage examples:
# - ./run-tests.sh --group 20221124
# - ./run-tests.sh --exclude-group slow
php -r 'echo "\nPHP version " . phpversion() . ". ";';
composer update --quiet
#php -r 'echo "\nPHP version " . phpversion() . ". ";'
php ./vendor/phpunit/phpunit/phpunit $@
if [ -z $1 ];
then
echo "Running all unit tests.\n"
php ./vendor/phpunit/phpunit/phpunit
else
echo "Running all unit tests, except tests marked with @group $1.\n"
php ./vendor/phpunit/phpunit/phpunit --exclude-group $1
fi