-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
- Added .travis.yml - Updated composer.json: - dev requirements - legacy_dir configuration - Added bootstrap.php, config.php-DEVELOPMENT & phpunit.xml
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
/vendor/ | ||
composer.lock | ||
ezpublish_legacy | ||
bin | ||
config.php |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
language: php | ||
|
||
# run tests on php misc php versions | ||
php: | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
|
||
# 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 | ||
# 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 | ||
|
||
# execute phpunit as the script command | ||
script: "./bin/phpunit -d date.timezone='America/New_York' -d memory_limit=-1" | ||
|
||
# disable mail notifications | ||
notification: | ||
email: false | ||
|
||
# reduce depth (history) of git checkout | ||
git: | ||
depth: 30 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
/** | ||
* File containing the bootstrapping of eZ Publish API for unit test use | ||
* | ||
* Setups class loading. | ||
* | ||
* @copyright Copyright (C) eZ Systems AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
* @version //autogentag// | ||
*/ | ||
|
||
use eZ\Publish\Core\MVC\Legacy\Kernel as LegacyKernel; | ||
use eZ\Publish\Core\MVC\Legacy\Kernel\CLIHandler as LegacyKernelCLI; | ||
|
||
// Get global config.php settings | ||
if ( !file_exists( __DIR__ . '/config.php' ) ) | ||
{ | ||
if ( !symlink( __DIR__ . '/config.php-DEVELOPMENT', __DIR__ . '/config.php' ) ) | ||
{ | ||
throw new \RuntimeException( 'Could not symlink config.php-DEVELOPMENT to config.php, please copy config.php-DEVELOPMENT to config.php & customize to your needs!' ); | ||
} | ||
} | ||
|
||
if ( !( $settings = include ( __DIR__ . '/config.php' ) ) ) | ||
{ | ||
throw new \RuntimeException( 'Could not read config.php, please copy config.php-DEVELOPMENT to config.php & customize to your needs!' ); | ||
} | ||
|
||
// Setup class loader, detect ezpublish-community repo context and use vendor files from there if that is the case | ||
$rootDir = __DIR__; | ||
if ( ( $vendorPathPos = strrpos( $rootDir, '/vendor/ezsystems/ezpublish' ) ) !== false ) | ||
$rootDir = substr( $rootDir, 0, $vendorPathPos ); | ||
require_once $rootDir . "/vendor/autoload.php"; | ||
|
||
|
||
// Bootstrap eZ Publish legacy kernel if configured | ||
if ( !empty( $settings['legacy_dir'] ) ) | ||
{ | ||
if ( !defined( 'EZCBASE_ENABLED' ) ) | ||
{ | ||
define( 'EZCBASE_ENABLED', false ); | ||
require_once $settings['legacy_dir'] . '/autoload.php'; | ||
} | ||
|
||
if ( empty( $_ENV['legacyKernel'] ) ) | ||
{ | ||
// Define $legacyKernelHandler to whatever you need before loading this bootstrap file. | ||
// CLI handler is used by defaut, but you must use \ezpKernelWeb if not in CLI context (i.e. REST server) | ||
// $legacyKernelHandler can be a closure returning the appropriate kernel handler (to avoid autoloading issues) | ||
if ( isset( $legacyKernelHandler ) ) | ||
{ | ||
$legacyKernelHandler = $legacyKernelHandler instanceof \Closure ? $legacyKernelHandler() : $legacyKernelHandler; | ||
} | ||
else | ||
{ | ||
$legacyKernelHandler = new LegacyKernelCLI; | ||
} | ||
$legacyKernel = new LegacyKernel( $legacyKernelHandler, $settings['legacy_dir'], getcwd() ); | ||
|
||
// Exposing in env variables in order be able to use them in test cases. | ||
$_ENV['legacyKernel'] = $legacyKernel; | ||
$_ENV['legacyPath'] = $settings['legacy_dir']; | ||
} | ||
|
||
$_ENV['imagemagickConvertPath'] = $settings['imagemagick_convert_path']; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,12 +10,25 @@ | |
], | ||
"minimum-stability": "stable", | ||
"require": { | ||
"ezsystems/ezpublish-legacy": ">=2014.11" | ||
"ezsystems/ezpublish-legacy": ">=2014.11", | ||
"ezsystems/ezpublish-kernel": "dev-master" | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
andrerom
Contributor
|
||
}, | ||
"require-dev": { | ||
"matthiasnoback/symfony-dependency-injection-test": "0.*", | ||
"phpunit/phpunit": "~4.1.3", | ||
"mikey179/vfsStream": "1.1.0", | ||
"mockery/mockery": "dev-master" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"eZ\\Bundle\\EzPublishLegacyBundle\\": "bundle/", | ||
"eZ\\Publish\\Core\\MVC\\Legacy\\": "mvc" | ||
} | ||
}, | ||
"config": { | ||
"bin-dir": "bin" | ||
}, | ||
"extra": { | ||
"ezpublish-legacy-dir": "ezpublish_legacy" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
|
||
mkdir -p ~/.composer | ||
echo '{ "config": { "github-oauth": { "github.com": "cf20c86050d2c206b34d1fa8958dca40bfe08afd" } } }' > ~/.composer/config.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* eZ Publish 5.x config.php file | ||
* | ||
* Returns global application settings | ||
* Usually contain settings needed to setup services needed for ezp startup. | ||
* | ||
* @copyright Copyright (C) eZ Systems AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
* @version //autogentag// | ||
* | ||
* @doc Copy this file to config.php to get started! | ||
*/ | ||
|
||
// Optional: only for development, comment in production | ||
error_reporting( E_ALL | E_STRICT ); | ||
|
||
// Required: Settings bellow are runtime settings that needs to be set here, you can | ||
// optionally also override any other setting here. | ||
return array( | ||
// The cache directory | ||
'cache_dir' => __DIR__ . "/var/cache", | ||
|
||
// 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' | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<phpunit | ||
backupGlobals="false" | ||
backupStaticAttributes="false" | ||
bootstrap="bootstrap.php" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
colors="false" | ||
> | ||
<testsuites> | ||
<testsuite name="eZ Publish Legacy MVC suite"> | ||
<directory>mvc</directory> | ||
</testsuite> | ||
<testsuite name="eZ Publish Legacy Bundle suite"> | ||
<directory>bundle</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
Shouldn't legacy bridge also receive a release which requires
"ezsystems/ezpublish-kernel": "~6.0.0@alpha"
?Right now, legacy cannot be installed in 15.03 due to
ezsystems/ezpublish-kernel
versioning conflicts.