Allow hhvm php5.2 and php-nightly to fail, define ARRAY_FILTER_USE_* to try and avoid hhvm failure

This commit is contained in:
R. Eric Wheeler 2016-07-20 13:07:02 -07:00
parent 8bb6d1f55c
commit 46c9502177
2 changed files with 15 additions and 0 deletions

View File

@ -1,11 +1,19 @@
language: php language: php
php: php:
- '5.2'
- '5.3'
- '5.4' - '5.4'
- '5.5' - '5.5'
- '5.6' - '5.6'
- '7.0' - '7.0'
- hhvm - hhvm
- nightly - nightly
matrix:
allow_failures:
- php: 5.2
- php: hhvm
- php: nightly
before_script: before_script:
- composer install --dev - composer install --dev

View File

@ -269,6 +269,13 @@ class ArrayObjectArrayTest extends \PHPUnit_Framework_TestCase
$this->assertSame(array_filter($this->workingMultiArray), $this->arrayObjectArrayMulti->array_filter()); $this->assertSame(array_filter($this->workingMultiArray), $this->arrayObjectArrayMulti->array_filter());
$this->assertSame(array_filter($this->workingMultiArray, $array_filter), $this->arrayObjectArrayMulti->array_filter($array_filter)); $this->assertSame(array_filter($this->workingMultiArray, $array_filter), $this->arrayObjectArrayMulti->array_filter($array_filter));
// The third parameter was added in php 5.6 // The third parameter was added in php 5.6
if(!defined('ARRAY_FILTER_USE_BOTH')) {
define('ARRAY_FILTER_USE_BOTH', 1);
}
if(!defined('ARRAY_FILTER_USE_KEY')) {
define('ARRAY_FILTER_USE_KEY', 2);
}
if (PHP_VERSION_ID >= 50600) { if (PHP_VERSION_ID >= 50600) {
$this->assertSame(array_filter($this->workingMultiArray, $array_filter, ARRAY_FILTER_USE_BOTH), $this->arrayObjectArrayMulti->array_filter($array_filter, ARRAY_FILTER_USE_BOTH)); $this->assertSame(array_filter($this->workingMultiArray, $array_filter, ARRAY_FILTER_USE_BOTH), $this->arrayObjectArrayMulti->array_filter($array_filter, ARRAY_FILTER_USE_BOTH));
$this->assertSame(array_filter($this->workingMultiArray, $array_filter, ARRAY_FILTER_USE_KEY), $this->arrayObjectArrayMulti->array_filter($array_filter, ARRAY_FILTER_USE_KEY)); $this->assertSame(array_filter($this->workingMultiArray, $array_filter, ARRAY_FILTER_USE_KEY), $this->arrayObjectArrayMulti->array_filter($array_filter, ARRAY_FILTER_USE_KEY));