Files
development/4dev/checking/phpunit.sh
Clemens Schwaighofer 9d65f5d7c1 phpunit script update, SmartyExtended allow load of plugins
- phpunit has better options set for testdox/php version
- SmartyExtended has logger class as option (argument 2) and options
- SmartyExtneded can via option set html escape and load of plugins
	- plugin array is set of
		- file: path to plugin file
		- type: what type this is
		- tag: tag name
		- callable: the callable for the tag name
	- will throw exceptions on plugin load
	- for all other things will set warning only and skip read
- fix the Smarty call with the logger option
- fix password test for PHP 8.4 password hash change

*IMPORTANT*
SmartyExtended($l10n, $logger, $cache_id, $compile_id)
The second argument is now the Logger class, this MUST be updated for all calls
2024-12-27 14:00:12 +09:00

47 lines
1.0 KiB
Bash
Executable File

#!/bin/env bash
base="/storage/var/www/html/developers/clemens/core_data/php_libraries/trunk/";
# -c phpunit.xml
# --testdox
# call with "-tt" to give verbose testdox output
# SUPPORTED: https://www.php.net/supported-versions.php
# call with -p <php version number> to force a certain php version
opt_testdox="";
php_bin="";
while [ -n "${1-}" ]; do
case "${1}" in
-t | --testdox)
opt_testdox="--testdox";
;;
-p | --php)
php_bin="/usr/bin/php${2-}";
shift
;;
# invalid option
-?*)
error "[!] Unknown option: '$1'."
;;
esac
shift;
done;
if [ ! -f "${php_bin}" ]; then
echo "Set php ${php_bin} does not exist";
exit;
fi;
php_bin="${php_bin} ";
# Note 4dev/tests/bootstrap.php has to be set as bootstrap file in phpunit.xml
phpunit_call="${php_bin}${base}vendor/bin/phpunit ${opt_testdox} -c ${base}phpunit.xml ${base}4dev/tests/";
${phpunit_call};
if [ -n "${php_bin}" ]; then
echo "CALLED WITH PHP: ${php_bin}$(${php_bin} --version)";
else
echo "Default PHP used: $(php --version)";
fi;
# __END__