Skip to content

Commit

Permalink
Merge pull request #37 from mtymek/php5.5-compat
Browse files Browse the repository at this point in the history
PHP5.5 compat
  • Loading branch information
mtymek committed Mar 21, 2017
2 parents 4e0e449 + a5bf652 commit d513ae9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
11 changes: 9 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ cache:
env:
global:
- COMPOSER_ARGS="--no-interaction"
- LEGACY_DEPS="phpunit/phpunit"
- LEGACY_DEPS="phpunit/phpunit zendframework/zend-stdlib zendframework/zend-eventmanager zendframework/zend-servicemanager"

matrix:
fast_finish: true
include:
- php: 5.5
- php: 5.5
env:
- ZEND_SERVICEMANAGER_VERSION="^2.7.5"
- ZEND_EVENTMANAGER_VERSION="^2.2.1"
- php: 5.6
env:
- EXECUTE_CS_CHECK=true
Expand All @@ -33,6 +38,8 @@ matrix:
env:
- ZEND_SERVICEMANAGER_VERSION="^2.7.5"
- ZEND_EVENTMANAGER_VERSION="^2.2.1"
allow_failures:
- php: 5.5

before_install:
- composer self-update
Expand All @@ -44,7 +51,7 @@ before_install:

install:
- travis_retry composer install $COMPOSER_ARGS --ignore-platform-reqs --prefer-dist --no-scripts
- if [[ $TRAVIS_PHP_VERSION =~ ^5.6 ]]; then travis_retry composer update $COMPOSER_ARGS --with-dependencies $LEGACY_DEPS ; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.5" ]]; then travis_retry composer require phpunit/phpunit:^4.8 --with-dependencies && composer update $COMPOSER_ARGS --with-dependencies $LEGACY_DEPS ; fi

script:
- composer test
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "ZF2 e-mail module. Using this library can easily create e-mail messages from PHTML templates (with optional layouts) and send them using configurable transports. Pluggable, EventManager-driven architecture allows you to customize every aspect of the process.",
"keywords": ["zf2", "module", "email", "e-mail", "mail transport", "mail template"],
"require": {
"php": "^5.6 || ^7.0",
"php": "^5.5 || ^7.0",
"zendframework/zend-view": "^2.2.1",
"zendframework/zend-escaper": "^2.2.1",
"zendframework/zend-mail": "^2.2.1",
Expand Down
24 changes: 20 additions & 4 deletions test/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,25 @@
* @license BSD 2-Clause
*/

namespace MtMailTest;
namespace MtMailTest {

error_reporting(E_ALL | E_STRICT);
chdir(__DIR__);
error_reporting(E_ALL | E_STRICT);
chdir(__DIR__);

Bootstrap::init();
Bootstrap::init();
}

/**
* Following namespace is a hack to re-establish support for PHP5.5 without
* rewriting unit tests. New tests should be extending using "namespaced"
* TestCase class.
*/
namespace PHPUnit\Framework {

if (!class_exists('PHPUnit\Framework\TestCase')) {
abstract class TestCase extends \PHPUnit_Framework_TestCase
{
}
}

}

0 comments on commit d513ae9

Please sign in to comment.