fixed tests for version PHP < 5.6 in array_filter

This commit is contained in:
R. Eric Wheeler 2016-07-20 12:47:06 -07:00
parent d8ebed2c87
commit 02e15145a1
3 changed files with 74 additions and 409 deletions

View File

@ -6,8 +6,8 @@
"php": ">=5.3.29" "php": ">=5.3.29"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^5.4", "phpunit/phpunit": "*",
"phpunit/php-code-coverage": "^4.0" "phpunit/php-code-coverage": "*"
}, },
"license": "MIT", "license": "MIT",
"authors": [ "authors": [

459
composer.lock generated
View File

@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "f7dc910a4c7447e0c3e4bd7d7008e8d8", "hash": "c4a8517082616e964929c7beaaf2beff",
"content-hash": "28a21950c17e891813923ac496f66d50", "content-hash": "1ed802871c0a99dc553de92f9b7e4ad0",
"packages": [], "packages": [],
"packages-dev": [ "packages-dev": [
{ {
@ -62,178 +62,39 @@
], ],
"time": "2015-06-14 21:17:01" "time": "2015-06-14 21:17:01"
}, },
{
"name": "myclabs/deep-copy",
"version": "1.5.1",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
"reference": "a8773992b362b58498eed24bf85005f363c34771"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/a8773992b362b58498eed24bf85005f363c34771",
"reference": "a8773992b362b58498eed24bf85005f363c34771",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"doctrine/collections": "1.*",
"phpunit/phpunit": "~4.1"
},
"type": "library",
"autoload": {
"psr-4": {
"DeepCopy\\": "src/DeepCopy/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Create deep copies (clones) of your objects",
"homepage": "https://github.com/myclabs/DeepCopy",
"keywords": [
"clone",
"copy",
"duplicate",
"object",
"object graph"
],
"time": "2015-11-20 12:04:31"
},
{
"name": "phpdocumentor/reflection-common",
"version": "1.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionCommon.git",
"reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c",
"reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c",
"shasum": ""
},
"require": {
"php": ">=5.5"
},
"require-dev": {
"phpunit/phpunit": "^4.6"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"phpDocumentor\\Reflection\\": [
"src"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jaap van Otterdijk",
"email": "opensource@ijaap.nl"
}
],
"description": "Common reflection classes used by phpdocumentor to reflect the code structure",
"homepage": "http://www.phpdoc.org",
"keywords": [
"FQSEN",
"phpDocumentor",
"phpdoc",
"reflection",
"static analysis"
],
"time": "2015-12-27 11:43:31"
},
{ {
"name": "phpdocumentor/reflection-docblock", "name": "phpdocumentor/reflection-docblock",
"version": "3.1.0", "version": "2.0.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "9270140b940ff02e58ec577c237274e92cd40cdd" "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9270140b940ff02e58ec577c237274e92cd40cdd", "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8",
"reference": "9270140b940ff02e58ec577c237274e92cd40cdd", "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.5", "php": ">=5.3.3"
"phpdocumentor/reflection-common": "^1.0@dev",
"phpdocumentor/type-resolver": "^0.2.0",
"webmozart/assert": "^1.0"
}, },
"require-dev": { "require-dev": {
"mockery/mockery": "^0.9.4", "phpunit/phpunit": "~4.0"
"phpunit/phpunit": "^4.4"
}, },
"type": "library", "suggest": {
"autoload": { "dflydev/markdown": "~1.0",
"psr-4": { "erusev/parsedown": "~1.0"
"phpDocumentor\\Reflection\\": [
"src/"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mike van Riel",
"email": "me@mikevanriel.com"
}
],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"time": "2016-06-10 09:48:41"
},
{
"name": "phpdocumentor/type-resolver",
"version": "0.2",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git",
"reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443",
"reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443",
"shasum": ""
},
"require": {
"php": ">=5.5",
"phpdocumentor/reflection-common": "^1.0"
},
"require-dev": {
"mockery/mockery": "^0.9.4",
"phpunit/phpunit": "^5.2||^4.8.24"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.0.x-dev" "dev-master": "2.0.x-dev"
} }
}, },
"autoload": { "autoload": {
"psr-4": { "psr-0": {
"phpDocumentor\\Reflection\\": [ "phpDocumentor": [
"src/" "src/"
] ]
} }
@ -245,10 +106,10 @@
"authors": [ "authors": [
{ {
"name": "Mike van Riel", "name": "Mike van Riel",
"email": "me@mikevanriel.com" "email": "mike.vanriel@naenius.com"
} }
], ],
"time": "2016-06-10 07:14:17" "time": "2015-02-03 12:10:50"
}, },
{ {
"name": "phpspec/prophecy", "name": "phpspec/prophecy",
@ -314,40 +175,39 @@
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
"version": "4.0.0", "version": "2.2.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "900370c81280cc0d942ffbc5912d80464eaee7e9" "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/900370c81280cc0d942ffbc5912d80464eaee7e9", "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979",
"reference": "900370c81280cc0d942ffbc5912d80464eaee7e9", "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^5.6 || ^7.0", "php": ">=5.3.3",
"phpunit/php-file-iterator": "~1.3", "phpunit/php-file-iterator": "~1.3",
"phpunit/php-text-template": "~1.2", "phpunit/php-text-template": "~1.2",
"phpunit/php-token-stream": "^1.4.2", "phpunit/php-token-stream": "~1.3",
"sebastian/code-unit-reverse-lookup": "~1.0",
"sebastian/environment": "^1.3.2", "sebastian/environment": "^1.3.2",
"sebastian/version": "~1.0|~2.0" "sebastian/version": "~1.0"
}, },
"require-dev": { "require-dev": {
"ext-xdebug": ">=2.1.4", "ext-xdebug": ">=2.1.4",
"phpunit/phpunit": "^5.4" "phpunit/phpunit": "~4"
}, },
"suggest": { "suggest": {
"ext-dom": "*", "ext-dom": "*",
"ext-xdebug": ">=2.4.0", "ext-xdebug": ">=2.2.1",
"ext-xmlwriter": "*" "ext-xmlwriter": "*"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "4.0.x-dev" "dev-master": "2.2.x-dev"
} }
}, },
"autoload": { "autoload": {
@ -373,7 +233,7 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2016-06-03 05:03:56" "time": "2015-10-06 15:47:00"
}, },
{ {
"name": "phpunit/php-file-iterator", "name": "phpunit/php-file-iterator",
@ -558,16 +418,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "5.4.6", "version": "4.8.26",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "2f1fc94b77ea6418bd6a06c64a1dac0645fbce59" "reference": "fc1d8cd5b5de11625979125c5639347896ac2c74"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2f1fc94b77ea6418bd6a06c64a1dac0645fbce59", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fc1d8cd5b5de11625979125c5639347896ac2c74",
"reference": "2f1fc94b77ea6418bd6a06c64a1dac0645fbce59", "reference": "fc1d8cd5b5de11625979125c5639347896ac2c74",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -576,27 +436,21 @@
"ext-pcre": "*", "ext-pcre": "*",
"ext-reflection": "*", "ext-reflection": "*",
"ext-spl": "*", "ext-spl": "*",
"myclabs/deep-copy": "~1.3", "php": ">=5.3.3",
"php": "^5.6 || ^7.0",
"phpspec/prophecy": "^1.3.1", "phpspec/prophecy": "^1.3.1",
"phpunit/php-code-coverage": "^4.0", "phpunit/php-code-coverage": "~2.1",
"phpunit/php-file-iterator": "~1.4", "phpunit/php-file-iterator": "~1.4",
"phpunit/php-text-template": "~1.2", "phpunit/php-text-template": "~1.2",
"phpunit/php-timer": "^1.0.6", "phpunit/php-timer": "^1.0.6",
"phpunit/phpunit-mock-objects": "^3.2", "phpunit/phpunit-mock-objects": "~2.3",
"sebastian/comparator": "~1.1", "sebastian/comparator": "~1.1",
"sebastian/diff": "~1.2", "sebastian/diff": "~1.2",
"sebastian/environment": "^1.3 || ^2.0", "sebastian/environment": "~1.3",
"sebastian/exporter": "~1.2", "sebastian/exporter": "~1.2",
"sebastian/global-state": "~1.0", "sebastian/global-state": "~1.0",
"sebastian/object-enumerator": "~1.0", "sebastian/version": "~1.0",
"sebastian/resource-operations": "~1.0",
"sebastian/version": "~1.0|~2.0",
"symfony/yaml": "~2.1|~3.0" "symfony/yaml": "~2.1|~3.0"
}, },
"conflict": {
"phpdocumentor/reflection-docblock": "3.0.2"
},
"suggest": { "suggest": {
"phpunit/php-invoker": "~1.1" "phpunit/php-invoker": "~1.1"
}, },
@ -606,7 +460,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "5.4.x-dev" "dev-master": "4.8.x-dev"
} }
}, },
"autoload": { "autoload": {
@ -632,33 +486,30 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2016-06-16 06:01:15" "time": "2016-05-17 03:09:28"
}, },
{ {
"name": "phpunit/phpunit-mock-objects", "name": "phpunit/phpunit-mock-objects",
"version": "3.2.3", "version": "2.3.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
"reference": "b13d0d9426ced06958bd32104653526a6c998a52" "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/b13d0d9426ced06958bd32104653526a6c998a52", "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983",
"reference": "b13d0d9426ced06958bd32104653526a6c998a52", "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"doctrine/instantiator": "^1.0.2", "doctrine/instantiator": "^1.0.2",
"php": "^5.6 || ^7.0", "php": ">=5.3.3",
"phpunit/php-text-template": "^1.2", "phpunit/php-text-template": "~1.2",
"sebastian/exporter": "^1.2" "sebastian/exporter": "~1.2"
},
"conflict": {
"phpunit/phpunit": "<5.4.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^5.4" "phpunit/phpunit": "~4.4"
}, },
"suggest": { "suggest": {
"ext-soap": "*" "ext-soap": "*"
@ -666,7 +517,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "3.2.x-dev" "dev-master": "2.3.x-dev"
} }
}, },
"autoload": { "autoload": {
@ -691,52 +542,7 @@
"mock", "mock",
"xunit" "xunit"
], ],
"time": "2016-06-12 07:37:26" "time": "2015-10-02 06:51:40"
},
{
"name": "sebastian/code-unit-reverse-lookup",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
"reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/c36f5e7cfce482fde5bf8d10d41a53591e0198fe",
"reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe",
"shasum": ""
},
"require": {
"php": ">=5.6"
},
"require-dev": {
"phpunit/phpunit": "~5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Looks up which function or method a line of code belongs to",
"homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
"time": "2016-02-13 06:45:14"
}, },
{ {
"name": "sebastian/comparator", "name": "sebastian/comparator",
@ -1022,52 +828,6 @@
], ],
"time": "2015-10-12 03:26:01" "time": "2015-10-12 03:26:01"
}, },
{
"name": "sebastian/object-enumerator",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-enumerator.git",
"reference": "d4ca2fb70344987502567bc50081c03e6192fb26"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/d4ca2fb70344987502567bc50081c03e6192fb26",
"reference": "d4ca2fb70344987502567bc50081c03e6192fb26",
"shasum": ""
},
"require": {
"php": ">=5.6",
"sebastian/recursion-context": "~1.0"
},
"require-dev": {
"phpunit/phpunit": "~5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Traverses array structures and object graphs to enumerate all referenced objects",
"homepage": "https://github.com/sebastianbergmann/object-enumerator/",
"time": "2016-01-28 13:25:10"
},
{ {
"name": "sebastian/recursion-context", "name": "sebastian/recursion-context",
"version": "1.0.2", "version": "1.0.2",
@ -1121,71 +881,21 @@
"homepage": "http://www.github.com/sebastianbergmann/recursion-context", "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
"time": "2015-11-11 19:50:13" "time": "2015-11-11 19:50:13"
}, },
{
"name": "sebastian/resource-operations",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/resource-operations.git",
"reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
"reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
"shasum": ""
},
"require": {
"php": ">=5.6.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Provides a list of PHP built-in functions that operate on resources",
"homepage": "https://www.github.com/sebastianbergmann/resource-operations",
"time": "2015-07-28 20:34:47"
},
{ {
"name": "sebastian/version", "name": "sebastian/version",
"version": "2.0.0", "version": "1.0.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/version.git", "url": "https://github.com/sebastianbergmann/version.git",
"reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5" "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
"reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
"shasum": "" "shasum": ""
}, },
"require": {
"php": ">=5.6"
},
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": { "autoload": {
"classmap": [ "classmap": [
"src/" "src/"
@ -1204,29 +914,29 @@
], ],
"description": "Library that helps with managing the version number of Git-hosted PHP projects", "description": "Library that helps with managing the version number of Git-hosted PHP projects",
"homepage": "https://github.com/sebastianbergmann/version", "homepage": "https://github.com/sebastianbergmann/version",
"time": "2016-02-04 12:56:52" "time": "2015-06-21 13:59:46"
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",
"version": "v3.1.2", "version": "v2.8.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/yaml.git", "url": "https://github.com/symfony/yaml.git",
"reference": "2884c26ce4c1d61aebf423a8b912950fe7c764de" "reference": "dba4bb5846798cd12f32e2d8f3f35d77045773c8"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/2884c26ce4c1d61aebf423a8b912950fe7c764de", "url": "https://api.github.com/repos/symfony/yaml/zipball/dba4bb5846798cd12f32e2d8f3f35d77045773c8",
"reference": "2884c26ce4c1d61aebf423a8b912950fe7c764de", "reference": "dba4bb5846798cd12f32e2d8f3f35d77045773c8",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.5.9" "php": ">=5.3.9"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "3.1-dev" "dev-master": "2.8-dev"
} }
}, },
"autoload": { "autoload": {
@ -1253,56 +963,7 @@
], ],
"description": "Symfony Yaml Component", "description": "Symfony Yaml Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-06-29 05:41:56" "time": "2016-06-29 05:29:29"
},
{
"name": "webmozart/assert",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/webmozart/assert.git",
"reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webmozart/assert/zipball/30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde",
"reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "^4.6"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"psr-4": {
"Webmozart\\Assert\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Bernhard Schussek",
"email": "bschussek@gmail.com"
}
],
"description": "Assertions to validate method input/output with nice error messages.",
"keywords": [
"assert",
"check",
"validate"
],
"time": "2015-08-24 13:29:44"
} }
], ],
"aliases": [], "aliases": [],

View File

@ -168,8 +168,8 @@ class ArrayObjectArrayTest extends \PHPUnit_Framework_TestCase
*/ */
public function testObjectArrayIsExtended() public function testObjectArrayIsExtended()
{ {
$this->assertInstanceOf(ArrayObjectArray::class, $this->arrayObjectArray); $this->assertInstanceOf('Sikofitt\Utility\ArrayObjectArray', $this->arrayObjectArray);
$this->assertInstanceOf(\ArrayObject::class, $this->arrayObjectArray); $this->assertInstanceOf('\ArrayObject', $this->arrayObjectArray);
$this->assertSame($this->workingArray, $this->arrayObjectArray->getArrayCopy()); $this->assertSame($this->workingArray, $this->arrayObjectArray->getArrayCopy());
$this->assertCount(4, $this->arrayObjectArray); $this->assertCount(4, $this->arrayObjectArray);
@ -225,8 +225,7 @@ class ArrayObjectArrayTest extends \PHPUnit_Framework_TestCase
* @covers Sikofitt\Utility\ArrayObjectArray::__call * @covers Sikofitt\Utility\ArrayObjectArray::__call
* @covers Sikofitt\Utility\ArrayObjectArray::array_fill * @covers Sikofitt\Utility\ArrayObjectArray::array_fill
*/ */
public function testArrayFunctions() public function testArrayFunctions() {
{
$key_comp_function = function ($a, $b) { $key_comp_function = function ($a, $b) {
if ($a === $b) { if ($a === $b) {
return 0; return 0;
@ -244,8 +243,8 @@ class ArrayObjectArrayTest extends \PHPUnit_Framework_TestCase
$this->assertSame(array_chunk($this->workingArray, 2), $this->arrayObjectArray->array_chunk(2)); $this->assertSame(array_chunk($this->workingArray, 2), $this->arrayObjectArray->array_chunk(2));
$this->assertSame(array_chunk($this->workingArray, 2, true), $this->arrayObjectArray->array_chunk(2, true)); $this->assertSame(array_chunk($this->workingArray, 2, true), $this->arrayObjectArray->array_chunk(2, true));
// array_column // array_column
$this->assertSame(array_column($this->workingMultiArray, 'first_name'), $this->arrayObjectArrayMulti->array_column('first_name')); // $this->assertSame(array_column($this->workingMultiArray, 'first_name'), $this->arrayObjectArrayMulti->array_column('first_name'));
$this->assertSame(array_column($this->workingMultiArray, 'first_name', 'id'), $this->arrayObjectArrayMulti->array_column('first_name', 'id')); // $this->assertSame(array_column($this->workingMultiArray, 'first_name', 'id'), $this->arrayObjectArrayMulti->array_column('first_name', 'id'));
// array_combine // array_combine
$this->assertSame(array_combine($this->singleArrayOne, $this->singleArrayTwo), $this->arrayObjectSingle->array_combine($this->singleArrayTwo)); $this->assertSame(array_combine($this->singleArrayOne, $this->singleArrayTwo), $this->arrayObjectSingle->array_combine($this->singleArrayTwo));
// array_count_values // array_count_values
@ -265,10 +264,15 @@ class ArrayObjectArrayTest extends \PHPUnit_Framework_TestCase
// array_fill // array_fill
$this->assertSame(array_fill(5, 6, 'banana'), $this->arrayObjectArray->array_fill(5, 6, 'banana')); $this->assertSame(array_fill(5, 6, 'banana'), $this->arrayObjectArray->array_fill(5, 6, 'banana'));
// array_filter // array_filter
if (!defined('ARRAY_FILTER_USE_BOTH')) {
define('ARRAY_FILTER_USE_BOTH', 1);
}
$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));
$this->assertSame(array_filter($this->workingMultiArray, $array_filter, ARRAY_FILTER_USE_BOTH), $this->arrayObjectArrayMulti->array_filter($array_filter, ARRAY_FILTER_USE_BOTH)); if (PHP_VERSION_ID >= 50600) {
$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_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));
}
// array_flip // array_flip
$this->assertSame(array_flip($this->workingArray), $this->arrayObjectArray->array_flip()); $this->assertSame(array_flip($this->workingArray), $this->arrayObjectArray->array_flip());
$this->assertSame(array_flip($this->singleArrayOne), $this->arrayObjectSingle->array_flip()); $this->assertSame(array_flip($this->singleArrayOne), $this->arrayObjectSingle->array_flip());