[feature/tests] Add extension-testframework from phpBB gallery
This commit is contained in:
21
travis/install-php-extensions.sh
Executable file
21
travis/install-php-extensions.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# @copyright (c) 2013 phpBB Group
|
||||
# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
#
|
||||
set -e
|
||||
|
||||
function add_ext_to_php_ini
|
||||
{
|
||||
echo "extension=$1.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
|
||||
}
|
||||
|
||||
# redis
|
||||
git clone git://github.com/nicolasff/phpredis.git
|
||||
cd phpredis
|
||||
phpize
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
cd ..
|
||||
add_ext_to_php_ini 'redis'
|
||||
41
travis/phpunit-mysql-travis.xml
Normal file
41
travis/phpunit-mysql-travis.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit backupGlobals="true"
|
||||
backupStaticAttributes="true"
|
||||
colors="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="false"
|
||||
syntaxCheck="true"
|
||||
strict="true"
|
||||
verbose="true"
|
||||
bootstrap="../tests/bootstrap.php">
|
||||
<testsuites>
|
||||
<testsuite name="phpBB Test Suite">
|
||||
<directory suffix="_test.php">../tests/</directory>
|
||||
<exclude>tests/functional</exclude>
|
||||
</testsuite>
|
||||
<testsuite name="phpBB Functional Tests">
|
||||
<directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<groups>
|
||||
<exclude>
|
||||
<group>slow</group>
|
||||
</exclude>
|
||||
</groups>
|
||||
|
||||
<php>
|
||||
<server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\mysqli" />
|
||||
<server name="PHPBB_TEST_DBHOST" value="0.0.0.0" />
|
||||
<server name="PHPBB_TEST_DBPORT" value="3306" />
|
||||
<server name="PHPBB_TEST_DBNAME" value="phpbb_tests" />
|
||||
<server name="PHPBB_TEST_DBUSER" value="root" />
|
||||
<server name="PHPBB_TEST_DBPASSWD" value="" />
|
||||
<server name="PHPBB_TEST_REDIS_HOST" value="localhost" />
|
||||
<server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/>
|
||||
<server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/" />
|
||||
</php>
|
||||
</phpunit>
|
||||
43
travis/phpunit-postgres-travis.xml
Normal file
43
travis/phpunit-postgres-travis.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit backupGlobals="true"
|
||||
backupStaticAttributes="true"
|
||||
colors="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="false"
|
||||
syntaxCheck="true"
|
||||
strict="true"
|
||||
verbose="true"
|
||||
bootstrap="../tests/bootstrap.php">
|
||||
<testsuites>
|
||||
<testsuite name="phpBB Test Suite">
|
||||
<directory suffix="_test.php">../tests/</directory>
|
||||
<exclude>tests/functional</exclude>
|
||||
</testsuite>
|
||||
<testsuite name="phpBB Functional Tests">
|
||||
<directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<groups>
|
||||
<exclude>
|
||||
<group>slow</group>
|
||||
</exclude>
|
||||
</groups>
|
||||
|
||||
<php>
|
||||
<!-- "Real" test database -->
|
||||
<!-- uncomment, otherwise sqlite memory runs -->
|
||||
<server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\postgres"/>
|
||||
<server name="PHPBB_TEST_DBHOST" value="localhost" />
|
||||
<server name="PHPBB_TEST_DBPORT" value="5432" />
|
||||
<server name="PHPBB_TEST_DBNAME" value="phpbb_tests" />
|
||||
<server name="PHPBB_TEST_DBUSER" value="postgres" />
|
||||
<server name="PHPBB_TEST_DBPASSWD" value="" />
|
||||
<server name="PHPBB_TEST_REDIS_HOST" value="localhost" />
|
||||
<server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/>
|
||||
<server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/" />
|
||||
</php>
|
||||
</phpunit>
|
||||
54
travis/setup-webserver.sh
Executable file
54
travis/setup-webserver.sh
Executable file
@@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# @copyright (c) 2013 phpBB Group
|
||||
# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
#
|
||||
set -e
|
||||
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -qq nginx realpath
|
||||
|
||||
sudo service nginx stop
|
||||
|
||||
DIR=$(dirname "$0")
|
||||
PHPBB_ROOT_PATH=$(realpath "$DIR/../../../..")
|
||||
|
||||
NGINX_CONF="/etc/nginx/sites-enabled/default"
|
||||
|
||||
PHP_FPM_BIN="$HOME/.phpenv/versions/$TRAVIS_PHP_VERSION/sbin/php-fpm"
|
||||
PHP_FPM_CONF="$DIR/php-fpm.conf"
|
||||
PHP_FPM_SOCK=$(realpath "$DIR")/php-fpm.sock
|
||||
|
||||
USER=$(whoami)
|
||||
|
||||
# php-fpm configuration
|
||||
echo "
|
||||
[global]
|
||||
|
||||
[travis]
|
||||
user = $USER
|
||||
group = $USER
|
||||
listen = $PHP_FPM_SOCK
|
||||
pm = static
|
||||
pm.max_children = 2
|
||||
|
||||
php_admin_value[memory_limit] = 128M
|
||||
" > $PHP_FPM_CONF
|
||||
|
||||
# nginx configuration
|
||||
echo "
|
||||
server {
|
||||
listen 80;
|
||||
root $PHPBB_ROOT_PATH/;
|
||||
index index.php index.html;
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass unix:$PHP_FPM_SOCK;
|
||||
include fastcgi_params;
|
||||
}
|
||||
}
|
||||
" | sudo tee $NGINX_CONF > /dev/null
|
||||
|
||||
# Start daemons
|
||||
sudo $PHP_FPM_BIN --fpm-config "$DIR/php-fpm.conf"
|
||||
sudo service nginx start
|
||||
Reference in New Issue
Block a user