From afacffa69b0b10bca7e45bcf071460396be6d7d6 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 5 Mar 2020 11:23:58 +0100 Subject: [PATCH] use domain from phpunix.xml and output Apache error.log so diagnose PHP errors in requests --- .travis.yml | 2 ++ doc/phpunit_bootstrap.php | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index aff73d7072..88de27eb3a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -71,6 +71,8 @@ script: # --source_dir `pwd` --start_db '' --autostart_db '' --start_webserver '' --webserver_user '' # Ubuntu has problems with #!/usr/bin/env php -dapc.enable=1, it stalls forever - vendor/bin/phpunit -c doc -dapc.enable_cli=1 + # output Apache error.log to diagnose PHP errors in requests send by unit-tests + - sudo cat /var/log/apache2/error.log # do not run syntax check for hhvm, as it always fails / get terminated after 10m - test $(phpenv version-name) = 'hhvm' || ./doc/php_syntax_check.sh diff --git a/doc/phpunit_bootstrap.php b/doc/phpunit_bootstrap.php index f47530790f..f1d67cf440 100644 --- a/doc/phpunit_bootstrap.php +++ b/doc/phpunit_bootstrap.php @@ -30,6 +30,11 @@ if (ini_get('session.save_handler') === 'files' && !is_writable(ini_get('session { ini_set('session.save_path','/tmp'); // regular users may have no rights to apache's session dir } +// set domain from doc/phpunit.xml +if (!isset($_SERVER['HTTP_HOST']) && $GLOBALS['EGW_DOMAIN'] !== 'default') +{ + $_SERVER['HTTP_HOST'] = $GLOBALS['EGW_DOMAIN']; +} // Symlink api/src/fixtures/apps/* to root foreach(scandir($path=__DIR__.'/../api/tests/fixtures/apps') as $app)