From 3deff4909dbb9310d5a97ff173f7f2ae75504f69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edi=20Modri=C4=87?= Date: Fri, 17 Feb 2017 16:49:19 +0100 Subject: [PATCH] Remove the need for copying config to eZ kernel --- .travis.yml | 4 ---- README.md | 11 ++--------- bootstrap.php | 21 +++++++++++++++++++-- composer.json | 10 ++-------- config.php-DEVELOPMENT | 32 +++++++------------------------- phpunit.xml | 2 +- 6 files changed, 31 insertions(+), 49 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3eef3f77..ec63be18 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,10 +34,6 @@ before_install: # install dependencies install: travis_wait composer install --prefer-source -# setup requirements for running unit tests -before_script: - - cp config.php-DEVELOPMENT vendor/ezsystems/ezpublish-kernel/config.php - # execute phpunit as the script command script: - ./vendor/bin/phpunit -d memory_limit=-1 --colors -c $CONFIG --coverage-clover=coverage.xml diff --git a/README.md b/README.md index 0ce70aff..59fe380a 100644 --- a/README.md +++ b/README.md @@ -45,19 +45,12 @@ Unit tests There are two sets of tests available, unit tests and legacy integration tests. -To run the tests, first you need to install dependencies with Composer: - - $ curl -sS https://getcomposer.org/installer | php - $ php composer.phar install - -After that, copy (or symlink) `config.php-DEVELOPMENT` file from TagsBundle to `config.php` in eZ Publish kernel: - - $ cp config.php-DEVELOPMENT vendor/ezsystems/ezpublish-kernel/config.php - ### Running unit tests + $ composer install $ composer test ### Running legacy integration tests + $ composer install $ composer test-integration diff --git a/bootstrap.php b/bootstrap.php index 98cbbe64..dac7ec31 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -1,8 +1,25 @@ __DIR__, + 'install_dir' => $kernelDir, + // Path to the containerBuilder.php file used by service container - 'container_builder_path' => __DIR__ . '/eZ/Publish/Core/settings/containerBuilder.php', - // The cache directory - 'cache_dir' => __DIR__ . '/var/cache', + 'container_builder_path' => $kernelDir . '/eZ/Publish/Core/settings/containerBuilder.php', - // The Legacy Kernel installation directory, detect legacy location - 'legacy_dir' => ( - is_dir('./ezpublish_legacy') ? - getcwd() . '/ezpublish_legacy' : - __DIR__ . '/vendor/ezsystems/ezpublish-legacy' - ), - 'imagemagick_convert_path' => '/usr/bin/convert', + // The cache directory + 'cache_dir' => $kernelDir . '/var/cache', ); diff --git a/phpunit.xml b/phpunit.xml index 8c81d2bf..fa682468 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.5/phpunit.xsd" backupGlobals="false" - bootstrap="vendor/autoload.php" + bootstrap="bootstrap.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true"