From e386c6a1534f1184bbf9480e67294eb910a1fa5c Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Fri, 28 Oct 2016 10:53:11 +1300 Subject: [PATCH] FIX: Refactor bootstrap.php to allow for code sharing with cms bootstrap --- .travis.yml | 3 +- tests/behat/serve-bootstrap.php | 48 +----------- tests/bootstrap.php | 125 ++---------------------------- tests/bootstrap/_manifest_exclude | 0 tests/bootstrap/cli.php | 33 ++++++++ tests/bootstrap/environment.php | 34 ++++++++ tests/bootstrap/init.php | 21 +++++ tests/bootstrap/mysite.php | 10 +++ tests/bootstrap/phpunit.php | 29 +++++++ 9 files changed, 137 insertions(+), 166 deletions(-) create mode 100644 tests/bootstrap/_manifest_exclude create mode 100644 tests/bootstrap/cli.php create mode 100644 tests/bootstrap/environment.php create mode 100644 tests/bootstrap/init.php create mode 100644 tests/bootstrap/mysite.php create mode 100644 tests/bootstrap/phpunit.php diff --git a/.travis.yml b/.travis.yml index a1dcb461f..5d0be1997 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,7 +54,8 @@ before_script: - "if [ \"$NPM_TEST\" = \"1\" ]; then nvm install $TRAVIS_NODE_VERSION && npm install; fi" - "if [ \"$BEHAT_TEST\" = \"1\" ]; then sh -e /etc/init.d/xvfb start; sleep 3; fi" - "if [ \"$BEHAT_TEST\" = \"1\" ]; then (vendor/bin/selenium-server-standalone > selenium.log 2>&1 &); fi" - - "if [ \"$BEHAT_TEST\" = \"1\" ]; then (vendor/bin/serve --bootstrap-file tests/behat/serve-bootstrap.php &> serve.log &); fi" + - "if [ \"$BEHAT_TEST\" = \"1\" ] && [ \"$CMS_TEST\" = \"\" ]; then (vendor/bin/serve --bootstrap-file tests/behat/serve-bootstrap.php &> serve.log &); fi" + - "if [ \"$BEHAT_TEST\" = \"1\" ] && [ \"$CMS_TEST\" = \"1\" ]; then (vendor/bin/serve --bootstrap-file cms/tests/behat/serve-bootstrap.php &> serve.log &); fi" script: - "if [ \"$PHPUNIT_TEST\" = \"1\" ] && [ \"$CMS_TEST\" = \"\" ]; then vendor/bin/phpunit; fi" - "if [ \"$PHPUNIT_TEST\" = \"1\" ] && [ \"$CMS_TEST\" = \"1\" ]; then vendor/bin/phpunit cms/tests; fi" diff --git a/tests/behat/serve-bootstrap.php b/tests/behat/serve-bootstrap.php index 700c813f3..e392dfd9e 100644 --- a/tests/behat/serve-bootstrap.php +++ b/tests/behat/serve-bootstrap.php @@ -1,47 +1,5 @@