-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtests.sh
executable file
·45 lines (34 loc) · 1.05 KB
/
tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
set -xe
composer_update () {
COMPOSER_ARGS=$1 ;
composer update ${COMPOSER_ARGS} ;
composer show ;
}
phpunit () {
COVERAGE=$1
if [[ ${COVERAGE} == '1' ]] ; then
echo "zend_extension=xdebug.so" > /etc/php7/conf.d/xdebug.ini ;
export PHPUNIT_ARGS='--coverage-text --coverage-html coverage' ;
fi ;
if [ ! -f phpunit.phar ]; then
curl -o phpunit.phar -L https://phar.phpunit.de/phpunit-7.phar ;
chmod +x phpunit.phar ;
fi ;
./phpunit.phar --version ;
./phpunit.phar --configuration phpunit.xml.dist --colors=never ${PHPUNIT_ARGS}
}
phpmd () {
if [ ! -f phpmd ]; then
curl -o phpmd -L http://static.phpmd.org/php/latest/phpmd.phar ;
chmod +x phpmd ;
fi ;
./phpmd src text ruleset.xml --reportfile-html phpmd.html ;
}
case $1 in
composer_update_prefer_latest) composer_update ;;
composer_update_prefer_lowest) composer_update '--prefer-lowest' ;;
phpunit) phpunit 0 ;;
phpunit_with_coverage) phpunit 1 ;;
phpmd) phpmd ;;
esac