mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-30 20:16:45 +00:00
fixed code for older versions of PHP
This commit is contained in:
+3
-3
@@ -8,7 +8,6 @@ cache:
|
||||
- $HOME/.composer/cache/files
|
||||
|
||||
php:
|
||||
- 5.2
|
||||
- 5.3
|
||||
- 5.4
|
||||
- 5.5
|
||||
@@ -25,13 +24,14 @@ before_install:
|
||||
- if [[ ! $TRAVIS_PHP_VERSION = hhvm* ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi
|
||||
|
||||
install:
|
||||
# Composer is not available on PHP 5.2
|
||||
- if [ ${TRAVIS_PHP_VERSION:0:3} != "5.2" ]; then travis_retry composer install; fi
|
||||
- travis_retry composer install
|
||||
|
||||
before_script:
|
||||
- if [ "$TWIG_EXT" == "yes" ]; then sh -c "cd ext/twig && phpize && ./configure --enable-twig && make && make install"; fi
|
||||
- if [ "$TWIG_EXT" == "yes" ]; then echo "extension=twig.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi
|
||||
|
||||
script: ./vendor/bin/simple-phpunit
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
exclude:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
* 1.34.0 (2017-XX-XX)
|
||||
|
||||
* n/a
|
||||
* dropped PHP 5.2 support
|
||||
|
||||
* 1.33.2 (2017-04-20)
|
||||
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
"forum": "https://groups.google.com/forum/#!forum/twig-users"
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.2.7"
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/phpunit-bridge": "~3.3@dev",
|
||||
|
||||
+2
-1
@@ -28,7 +28,8 @@ Slim, Yii, Laravel, Codeigniter and Kohana — just to name a few.
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
Twig needs at least **PHP 5.2.7** to run.
|
||||
Twig needs at least **PHP 5.2.7** to run. As of 1.34, the minimum requirement
|
||||
was bumped to **PHP 5.3.3**.
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
*/
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use PHPUnit\Framework\Constraint\Exception as ExceptionConstraint;
|
||||
|
||||
/**
|
||||
* Integration test helper.
|
||||
@@ -199,7 +198,7 @@ abstract class Twig_Test_IntegrationTestCase extends TestCase
|
||||
|
||||
if (false !== $exception) {
|
||||
list($class) = explode(':', $exception);
|
||||
$constraintClass = class_exists(ExceptionConstraint::class) ? ExceptionConstraint::class : \PHPUnit_Framework_Constraint_Exception::class;
|
||||
$constraintClass = class_exists('PHPUnit\Framework\Constraint\Exception') ? 'PHPUnit\Framework\Constraint\Exception' : 'PHPUnit_Framework_Constraint_Exception';
|
||||
$this->assertThat(null, new $constraintClass($class));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user