adding phpUnit 8.x as dev-requirement and try staring Apache in Travis for CalDAV tests

This commit is contained in:
Ralf Becker 2020-03-04 22:43:09 +01:00
parent e360932bdf
commit b448f9a021
6 changed files with 1799 additions and 30 deletions

View File

@ -13,25 +13,15 @@ matrix:
services:
- memcached
- mysql #we use mariadb instead installed via addons below
- mysql
# - postgres
#addons:
# mariadb: '10.0'
sudo: required
before_script:
- sudo apt-get update -qq
- sudo apt-get install -y libpcre3-dev
- sudo apt-get install -y libpcre3-dev apache2 libapache2-mod-fastcgi
- case $(phpenv version-name) in
"5.6")
yes "" | pecl install memcache;
yes "" | pecl install apcu-4.0.11;
yes "" | pecl install igbinary;
echo "extension=memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini;
phpenv config-rm xdebug.ini;
;;
"7"|"7.0"|"7.1"|"7.2")
yes "" | pecl install apcu;
echo "extension=memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini;
@ -41,17 +31,18 @@ before_script:
echo "extension=memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini;
;;
esac
- case $(phpenv version-name) in
"5.6")
composer require 'phpunit/phpunit:~5.7';
;;
"7"|"7.0")
composer require 'phpunit/phpunit:~6';
;;
*)
composer require --ignore-platform-reqs 'phpunit/phpunit:~7';
;;
esac
# enable apache with php-fpm see https://docs.travis-ci.com/user/languages/php/#apache--php
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
- sudo a2enmod rewrite actions fastcgi alias
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars
- sudo chown -R travis:travis /var/lib/apache2/fastcgi
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
# configure apache virtual hosts
- sudo cp -f doc/travis-ci-apache.conf /etc/apache2/sites-available/000-default.conf
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf
- sudo service apache2 restart
- curl -i http://localhost/egroupware/groupdav.php/
- php -m
- php -i
- php install-cli.php --ignore-platform-reqs

View File

@ -367,7 +367,7 @@ function function_backtrace($remove=0)
return $_GET['menuaction'] ? $_GET['menuaction'] : str_replace(EGW_SERVER_ROOT,'',$_SERVER['SCRIPT_FILENAME']);
}
if (!function_exists('lang') || defined('NO_LANG')) // setup declares an own version
if (!function_exists('lang') && !defined('NO_LANG')) // setup declares an own version
{
/**
* function to handle multilanguage support

View File

@ -45,12 +45,12 @@
],
"config": {
"platform": {
"php": "7.0"
"php": "7.2"
},
"sort-packages": true
},
"require": {
"php": ">=7.0,<=8.0.0alpha1",
"php": ">=7.2,<=8.0.0alpha1",
"ext-gd": "*",
"ext-json": "*",
"ext-mysqli": "*",
@ -101,6 +101,8 @@
"tinymce/tinymce": "^5.0"
},
"require-dev": {
"guzzlehttp/guzzle": "^6.5",
"phpunit/phpunit": "~8"
},
"suggests": {
"ext-opcache": "Opcode cache to speed up PHP",

1756
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -12,6 +12,7 @@
*/
// autoloader & check_load_extension
define('NO_LANG', true); // do NOT define lang(), as setup/inc/functions.inc.php also defines it
require_once realpath(__DIR__.'/../api/src/loader/common.php');
// backward compatibility with PHPunit 5.7

27
doc/travis-ci-apache.conf Normal file
View File

@ -0,0 +1,27 @@
<VirtualHost *:80>
# https://docs.travis-ci.com/user/languages/php/#apache--php
DocumentRoot %TRAVIS_BUILD_DIR%
# tests assume EGroupware to be under /egroupware not docroot
Alias /egroupware %TRAVIS_BUILD_DIR%
<Directory "%TRAVIS_BUILD_DIR%/">
Options FollowSymLinks MultiViews ExecCGI
AllowOverride All
Require all granted
</Directory>
# Wire up Apache to use Travis CI's php-fpm.
<IfModule mod_fastcgi.c>
AddHandler php5-fcgi .php
Action php5-fcgi /php5-fcgi
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization
<Directory /usr/lib/cgi-bin>
Require all granted
</Directory>
</IfModule>
</VirtualHost>