From b0b27a7d3e119ce62adaac97cb8c9ad2d3e44282 Mon Sep 17 00:00:00 2001 From: Maks3w Date: Tue, 20 Oct 2015 14:00:36 +0200 Subject: [PATCH 1/2] Decouple tests from external dependencies --- composer.json | 7 ------ test/ArrayUtilsTest.php | 55 ++++++++++++----------------------------- 2 files changed, 16 insertions(+), 46 deletions(-) diff --git a/composer.json b/composer.json index 4b61b0051..3c0544fa4 100644 --- a/composer.json +++ b/composer.json @@ -16,17 +16,10 @@ "php": ">=5.5" }, "require-dev": { - "zendframework/zend-config": "dev-develop as 2.6.0", - "zendframework/zend-serializer": "~2.5", "fabpot/php-cs-fixer": "1.7.*", "phpunit/PHPUnit": "~4.0", "athletic/athletic": "~0.1" }, - "suggest": { - "zendframework/zend-serializer": "Zend\\Serializer component" - }, - "minimum-stability": "dev", - "prefer-stable": true, "extra": { "branch-alias": { "dev-master": "2.7-dev", diff --git a/test/ArrayUtilsTest.php b/test/ArrayUtilsTest.php index 8127276fe..8db7a8ba3 100644 --- a/test/ArrayUtilsTest.php +++ b/test/ArrayUtilsTest.php @@ -12,9 +12,9 @@ use ArrayObject; use PHPUnit_Framework_TestCase as TestCase; use stdClass; -use Zend\Config\Config; use Zend\Stdlib\ArrayUtils; use Zend\Stdlib\ArrayUtils\MergeRemoveKey; +use Zend\Stdlib\Parameters; class ArrayUtilsTest extends TestCase { @@ -316,46 +316,23 @@ public function testAllowsRemovingKeys() public static function validIterators() { - return [ - [[ - 'foo' => 'bar', - ], [ - 'foo' => 'bar', - ]], - [new Config([ - 'foo' => [ - 'bar' => [ - 'baz' => [ - 'baz' => 'bat', - ], + $array = [ + 'foo' => [ + 'bar' => [ + 'baz' => [ + 'baz' => 'bat', ], ], - ]), [ - 'foo' => [ - 'bar' => [ - 'baz' => [ - 'baz' => 'bat', - ], - ], - ], - ]], - [new ArrayObject([ - 'foo' => [ - 'bar' => [ - 'baz' => [ - 'baz' => 'bat', - ], - ], - ], - ]), [ - 'foo' => [ - 'bar' => [ - 'baz' => [ - 'baz' => 'bat', - ], - ], - ], - ]], + ], + ]; + $arrayAccess = new ArrayObject($array); + $toArray = new Parameters($array); + + return [ + // Description => [input, expected array] + 'array' => [$array, $array], + 'Traversable' => [$arrayAccess, $array], + 'Traversable and toArray' => [$toArray, $array], ]; } From 78f60da53394d31acba879de7b0042d477f04309 Mon Sep 17 00:00:00 2001 From: Maks3w Date: Tue, 20 Oct 2015 14:02:19 +0200 Subject: [PATCH 2/2] Remove composer workaround --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 333fdba26..73f4c1482 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,7 +36,7 @@ before_install: - if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls ; fi install: - - COMPOSER_ROOT_VERSION=2.8.0 travis_retry composer install --no-interaction --ignore-platform-reqs + - travis_retry composer install --no-interaction --ignore-platform-reqs script: - if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then ./vendor/bin/phpunit --coverage-clover clover.xml ; fi