-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df04c0f
commit 593fd48
Showing
8 changed files
with
141 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
language: php | ||
#dist: trusty | ||
sudo: required | ||
|
||
php: | ||
- '5.3' | ||
- '5.4' | ||
- '5.5' | ||
- '5.6' | ||
- '7.0' | ||
- '7.1' | ||
|
||
services: | ||
- mysql | ||
- postgresql | ||
|
||
cache: | ||
directories: | ||
- vendor | ||
|
||
branches: | ||
only: | ||
- master | ||
- /^v\d/ | ||
|
||
notifications: | ||
email: false | ||
|
||
# also see: test/setup_vendor.sh | ||
before_script: | ||
- sudo locale-gen en_US.UTF-8 de_DE.UTF-8 fr_FR.UTF-8 | ||
- test/travis_database.sh | ||
- test/setup_vendor.sh | ||
|
||
script: | ||
# also see: modules/test/application/clicommands/PhpCommand.php | ||
# phpcs is disabled until fixed... | ||
# - php phpcs.phar -p --standard=icingaweb2.ruleset.xml --extensions=php --encoding=utf-8 application/ library/Icinga modules/ test/ | ||
- php phpunit.phar -c modules/test/phpunit.xml --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
/** | ||
* @codingStandardsIgnoreStart | ||
*/ | ||
class PHPUnit_Framework_TestCase extends \PHPUnit\Framework\TestCase | ||
{ | ||
} | ||
|
||
interface PHPUnit_Framework_Test extends \PHPUnit\Framework\Test | ||
{ | ||
} | ||
|
||
interface PHPUnit_Framework_TestListener extends \PHPUnit\Framework\TestListener | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
ICINGAWEB_HOME=${ICINGAWEB_HOME:="$(dirname "$(readlink -f $(dirname "$0"))")"} | ||
PHP_VERSION="$(php -r 'echo phpversion();')" | ||
PHPCS_VERSION=${PHPCS_VERSION:=2.9.1} | ||
MOCKERY_VERSION=${MOCKERY_VERSION:=0.9.9} | ||
HAMCREST_VERSION=${HAMCREST_VERSION:=2.0.0} | ||
|
||
if [ "$PHP_VERSION" '<' 5.6.0 ]; then | ||
PHPUNIT_VERSION=${PHPUNIT_VERSION:=4.8} | ||
else | ||
PHPUNIT_VERSION=${PHPUNIT_VERSION:=5.7} | ||
fi | ||
|
||
cd ${ICINGAWEB_HOME} | ||
|
||
test -d vendor || mkdir vendor | ||
|
||
# phpunit | ||
phpunit_path="vendor/phpunit-${PHPUNIT_VERSION}" | ||
if [ ! -e "${phpunit_path}".phar ]; then | ||
wget -O "${phpunit_path}".phar https://phar.phpunit.de/phpunit-${PHPUNIT_VERSION}.phar | ||
fi | ||
ln -svf "${phpunit_path}".phar phpunit.phar | ||
|
||
# phpcs | ||
phpcs_path="vendor/phpcs-${PHPCS_VERSION}" | ||
if [ ! -e "${phpcs_path}".phar ]; then | ||
wget -O "${phpcs_path}".phar \ | ||
https://github.com/squizlabs/PHP_CodeSniffer/releases/download/${PHPCS_VERSION}/phpcs.phar | ||
fi | ||
ln -svf "${phpcs_path}".phar phpcs.phar | ||
|
||
# mockery | ||
mockery_path="vendor/mockery-${MOCKERY_VERSION}" | ||
if [ ! -e "${mockery_path}".tar.gz ]; then | ||
wget -O "${mockery_path}".tar.gz \ | ||
https://github.com/mockery/mockery/archive/${MOCKERY_VERSION}.tar.gz | ||
fi | ||
if [ ! -d "${mockery_path}" ]; then | ||
tar xf "${mockery_path}".tar.gz -C vendor/ | ||
fi | ||
ln -svf "${mockery_path}"/library/Mockery | ||
ln -svf "${mockery_path}"/library/Mockery.php | ||
|
||
# hamcrest | ||
hamcrest_path="vendor/hamcrest-php-${HAMCREST_VERSION}" | ||
if [ ! -e "${hamcrest_path}".tar.gz ]; then | ||
wget -O "${hamcrest_path}".tar.gz \ | ||
https://github.com/hamcrest/hamcrest-php/archive/v${HAMCREST_VERSION}.tar.gz | ||
fi | ||
if [ ! -d "${hamcrest_path}" ]; then | ||
tar xf "${hamcrest_path}".tar.gz -C vendor/ | ||
fi | ||
ln -svf "${hamcrest_path}"/hamcrest/Hamcrest | ||
ln -svf "${hamcrest_path}"/hamcrest/Hamcrest.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
mysql -u root -e "GRANT ALL ON *.* TO icinga_unittest@localhost IDENTIFIED BY 'icinga_unittest'" | ||
|
||
export PGHOST=localhost | ||
export PGUSER=postgres | ||
|
||
psql -c "CREATE USER icinga_unittest WITH PASSWORD 'icinga_unittest'" | ||
psql -c "CREATE DATABASE icinga_unittest WITH OWNER icinga_unittest" |