Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,36 @@ language: php

# run tests on php misc php versions
php:
- 5.4
- 5.5
# - 5.4
# - 5.5
- 5.6

env:
- SUITE=phpunit
- SUITE=behat INSTALL="demoContentNonUniqueDB" PROFILE="demo" TEST="content"
- SUITE=behat INSTALL="demoCleanNonUniqueDB" PROFILE="legacyAdmin" TEST="full"

# test only master (+ Pull requests)
branches:
only:
- master

# setup requirements for running unit tests
before_script:
# TEMP get latests version of composer which is faster
##- composer self-update
# Disable xdebug to speed things up as we don't currently generate coverge on travis
- if [ $TRAVIS_PHP_VERSION != "hhvm" ]; then phpenv config-rm xdebug.ini ; fi
# Get ezpublish5 repo, and use it as the build dir
before_install:
# Setup github key to avoid api rate limit
- ./composer_install_github_key.sh
# Install packages using composer
- composer install --dev --prefer-dist
# Copy default test configuration
- cp config.php-DEVELOPMENT config.php
- if [[ $SUITE == "phpunit" ]]; then ./.travis/phpunit_before_install.sh; fi;
- if [[ $SUITE == "behat" ]]; then ./.travis/behat_before_install.sh; fi;

# setup requirements for running unit tests
before_script:
- if [[ $SUITE == "phpunit" ]]; then ./.travis/phpunit_before_script.sh; fi;
- if [[ $SUITE == "behat" ]]; then ./.travis/behat_before_script.sh; fi;

# execute phpunit as the script command
script: "./bin/phpunit -d date.timezone='America/New_York' -d memory_limit=-1"
# execute the test command
script:
- if [[ $SUITE == "phpunit" ]]; then ./bin/phpunit -d date.timezone='America/New_York' -d memory_limit=-1; fi;
- if [[ $SUITE == "behat" ]]; then ./bin/behat --profile $PROFILE --suite $TEST; fi;

# disable mail notifications
notification:
Expand Down
14 changes: 14 additions & 0 deletions .travis/behat_before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
export BRANCH_BUILD_DIR=$TRAVIS_BUILD_DIR
export TRAVIS_BUILD_DIR="$HOME/build/ezpublish-community"
cd "$HOME/build"

# Change the branch and/or remote to use a different ezpublish-community branch
git clone --depth 1 --single-branch --branch EZP-23934-remove_legacy_bridge https://github.com/ezsystems/ezpublish-community.git
cd ezpublish-community

# Use this if you depend on another branch for a dependency (only works for the ezsystems remote)
# (note that packagist may take time to update the references, leading to errors. Just retrigger the build)
#- composer require --no-update dev-MyCustomBranch
./bin/.travis/prepare_system.sh
./bin/.travis/prepare_sahi.sh
47 changes: 47 additions & 0 deletions .travis/behat_before_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/sh
echo "> Configuring legacy-bridge"

composer require --no-update "legacy-bridge:dev-master"

php ./bin/.travis/enablelegacybundle.php

# Load LegacyBundle routes
echo << EOF >> ezpublish/config/routing.yml

_ezpublishLegacyRoutes:
resource: '@EzPublishLegacyBundle/Resources/config/routing.yml'

EOF

# legacy mode
echo << EOF >> ezpublish/config/ezpublish.yml

ez_publish_legacy:
system:
behat_site_admin:
legacy_mode: true

EOF

# setup firewall rule
echo << EOF >> ezpublish/config/security.yml

ezpublish_setup:
pattern: ^/ezsetup
security: false

EOF

# Enabled eztpl templating engine
sed -i "s/'twig'/'eztpl', 'twig'/" ezpublish/config/config.yml


./bin/.travis/prepare_ezpublish.sh

# Replace legacy-bridge with the one from the pull-request
rm -rf vendor/ezsystems/legacy-bridge
mv "$BRANCH_BUILD_DIR" vendor/ezsystems/legacy-bridge

# Run setup wizard
php bin/behat --profile setupWizard --suite $INSTALL
php ezpublish/console assetic:dump --env=behat --no-debug
18 changes: 18 additions & 0 deletions .travis/enablelegacybundle.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* This file is part of the eZ Publish Kernel package
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/

$kernelPath = 'ezpublish/EzPublishKernel.php';

$kernelContents = file_get_contents( $kernelPath );
$kernelContents = preg_replace(
"/$\s+\);$$\s+switch/m",
",\n new eZ\Bundle\EzPublishLegacyBundle\EzPublishLegacyBundle( \$this )\n );\n\n switch",
$kernelContents
);

file_put_contents( $kernelPath, $kernelContents );
5 changes: 5 additions & 0 deletions .travis/phpunit_before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
# Install packages using composer
composer install --dev --prefer-dist
# Copy default test configuration
cp config.php-DEVELOPMENT config.php