From 8b34a5015202bb3adfdfbba4f70b8920495e1a5e Mon Sep 17 00:00:00 2001 From: Mallory Adams Date: Mon, 17 Aug 2020 14:30:26 -0400 Subject: [PATCH] Remove WP_Mock from the tests - composer remove --dev 10up/wp_mock - composer require --dev php-mock/php-mock-mockery - Manually replaced WP_Mock with PHPMockery WP_Mock has dependencies on older versions of packages. This ends up conflicting with the newer versions of more actively-developed packages. Removing this dependency allows us greater flexibility in the packages we install. --- wp-content/themes/theme/app/Theme/Plugins.php | 6 +- wp-content/themes/theme/composer.json | 4 +- wp-content/themes/theme/composer.lock | 1711 ++--------------- wp-content/themes/theme/peridot.php | 2 - .../spec/lib/whippet/template_tags.spec.php | 11 +- .../theme/spec/posts/custom_fields.spec.php | 9 +- .../theme/spec/posts/post_types.spec.php | 9 +- .../theme/spec/theme/analytics.spec.php | 11 +- .../themes/theme/spec/theme/media.spec.php | 21 +- .../themes/theme/spec/theme/menus.spec.php | 14 +- .../theme/spec/theme/pagination.spec.php | 12 +- .../themes/theme/spec/theme/plugins.spec.php | 107 +- .../themes/theme/spec/theme/scripts.spec.php | 78 +- .../theme/spec/theme/title_tag.spec.php | 14 +- .../themes/theme/spec/theme/widgets.spec.php | 26 +- .../themes/theme/spec/theme/wp_head.spec.php | 17 +- wp-content/themes/theme/vendor.phar | Bin 332893 -> 332893 bytes 17 files changed, 370 insertions(+), 1682 deletions(-) diff --git a/wp-content/themes/theme/app/Theme/Plugins.php b/wp-content/themes/theme/app/Theme/Plugins.php index ac42ee4..e7ecd31 100644 --- a/wp-content/themes/theme/app/Theme/Plugins.php +++ b/wp-content/themes/theme/app/Theme/Plugins.php @@ -13,6 +13,10 @@ public function __construct(array $required = []) { $this->required = $required; $this->path_to_wordpress = ABSPATH; + // For the tests + $this->requireOnce = function ($a) { + require_once($a); + }; } public function register() @@ -27,7 +31,7 @@ public function checkDependencies() return; } if (!function_exists('get_plugin_data')) { - require_once($this->path_to_wordpress . 'wp-admin/includes/plugin.php'); + call_user_func($this->requireOnce, $this->path_to_wordpress . 'wp-admin/includes/plugin.php'); } array_map([$this, 'addNotice'], $pluginsToActivate); } diff --git a/wp-content/themes/theme/composer.json b/wp-content/themes/theme/composer.json index 96b7fa5..848adf3 100644 --- a/wp-content/themes/theme/composer.json +++ b/wp-content/themes/theme/composer.json @@ -18,12 +18,12 @@ }, "require-dev": { "dxw/phar-install": "^1.0", - "10up/wp_mock": "^0.3.0", "mikey179/vfsstream": "^1.6", "peridot-php/peridot": "^1.19", "peridot-php/leo": "^1.6", "peridot-php/peridot-dot-reporter": "^1.0", - "dxw/php-cs-fixer-config": "^1.0" + "dxw/php-cs-fixer-config": "^1.0", + "php-mock/php-mock-mockery": "^1.3" }, "autoload": { "psr-4": { diff --git a/wp-content/themes/theme/composer.lock b/wp-content/themes/theme/composer.lock index b384371..3952f70 100644 --- a/wp-content/themes/theme/composer.lock +++ b/wp-content/themes/theme/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8db2e54ea596876e35d22f51fb3fc6c3", + "content-hash": "d10b3e501344c028d3a6da8142e2e2ce", "packages": [ { "name": "aura/autoload", @@ -200,91 +200,6 @@ } ], "packages-dev": [ - { - "name": "10up/wp_mock", - "version": "0.3.0", - "source": { - "type": "git", - "url": "https://github.com/10up/wp_mock.git", - "reference": "64956557e98ee4c8c56cd1e396e822adb4673714" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/10up/wp_mock/zipball/64956557e98ee4c8c56cd1e396e822adb4673714", - "reference": "64956557e98ee4c8c56cd1e396e822adb4673714", - "shasum": "" - }, - "require": { - "antecedent/patchwork": "^2.1", - "mockery/mockery": "^1.0", - "php": ">=7.0", - "phpunit/phpunit": ">=6.0" - }, - "require-dev": { - "behat/behat": "^3.0", - "satooshi/php-coveralls": "^1.0", - "sebastian/comparator": ">=1.2.3" - }, - "type": "library", - "autoload": { - "psr-4": { - "WP_Mock\\": "./php/WP_Mock" - }, - "classmap": [ - "php/WP_Mock.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0+" - ], - "description": "A mocking library to take the pain out of unit testing for WordPress", - "time": "2017-12-03T19:28:28+00:00" - }, - { - "name": "antecedent/patchwork", - "version": "2.1.12", - "source": { - "type": "git", - "url": "https://github.com/antecedent/patchwork.git", - "reference": "b98e046dd4c0acc34a0846604f06f6111654d9ea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/antecedent/patchwork/zipball/b98e046dd4c0acc34a0846604f06f6111654d9ea", - "reference": "b98e046dd4c0acc34a0846604f06f6111654d9ea", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": ">=4" - }, - "type": "library", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ignas Rudaitis", - "email": "ignas.rudaitis@gmail.com" - } - ], - "description": "Method redefinition (monkey-patching) functionality for PHP.", - "homepage": "http://patchwork2.org/", - "keywords": [ - "aop", - "aspect", - "interception", - "monkeypatching", - "redefinition", - "runkit", - "testing" - ], - "time": "2019-12-22T17:52:09+00:00" - }, { "name": "composer/semver", "version": "1.5.1", @@ -474,76 +389,6 @@ ], "time": "2020-08-10T19:35:50+00:00" }, - { - "name": "doctrine/instantiator", - "version": "1.3.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "f350df0268e904597e3bd9c4685c53e0e333feea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f350df0268e904597e3bd9c4685c53e0e333feea", - "reference": "f350df0268e904597e3bd9c4685c53e0e333feea", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^6.0", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.13", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-shim": "^0.11", - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2020-05-29T17:27:14+00:00" - }, { "name": "doctrine/lexer", "version": "1.2.1", @@ -926,30 +771,33 @@ }, { "name": "mockery/mockery", - "version": "1.3.3", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "60fa2f67f6e4d3634bb4a45ff3171fa52215800d" + "reference": "20cab678faed06fac225193be281ea0fddb43b93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/60fa2f67f6e4d3634bb4a45ff3171fa52215800d", - "reference": "60fa2f67f6e4d3634bb4a45ff3171fa52215800d", + "url": "https://api.github.com/repos/mockery/mockery/zipball/20cab678faed06fac225193be281ea0fddb43b93", + "reference": "20cab678faed06fac225193be281ea0fddb43b93", "shasum": "" }, "require": { "hamcrest/hamcrest-php": "^2.0.1", "lib-pcre": ">=7.0", - "php": ">=5.6.0" + "php": "^7.3 || ^8.0" + }, + "conflict": { + "phpunit/phpunit": "<8.0" }, "require-dev": { - "phpunit/phpunit": "^5.7.10|^6.5|^7.5|^8.5|^9.3" + "phpunit/phpunit": "^8.5 || ^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "1.4.x-dev" } }, "autoload": { @@ -987,61 +835,7 @@ "test double", "testing" ], - "time": "2020-08-11T18:10:21+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.10.1", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", - "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "replace": { - "myclabs/deep-copy": "self.version" - }, - "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], - "time": "2020-06-29T13:22:24+00:00" + "time": "2020-08-11T18:10:13+00:00" }, { "name": "paragonie/random_compat", @@ -1275,108 +1069,6 @@ "description": "Scopes for function binding and mixins", "time": "2016-02-22T13:27:54+00:00" }, - { - "name": "phar-io/manifest", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "phar-io/version": "^1.0.1", - "php": "^5.6 || ^7.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": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2017-03-05T18:14:27+00:00" - }, - { - "name": "phar-io/version", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "time": "2017-03-05T17:38:23+00:00" - }, { "name": "php-cs-fixer/diff", "version": "v1.3.0", @@ -1429,1104 +1121,200 @@ "time": "2018-02-15T16:58:55+00:00" }, { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", + "name": "php-mock/php-mock", + "version": "2.2.2", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + "url": "https://github.com/php-mock/php-mock.git", + "reference": "890d3e32e3a5f29715a8fd17debd87a0c9e614a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "url": "https://api.github.com/repos/php-mock/php-mock/zipball/890d3e32e3a5f29715a8fd17debd87a0c9e614a0", + "reference": "890d3e32e3a5f29715a8fd17debd87a0c9e614a0", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.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": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.2.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d870572532cd70bc3fab58f2e23ad423c8404c44" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d870572532cd70bc3fab58f2e23ad423c8404c44", - "reference": "d870572532cd70bc3fab58f2e23ad423c8404c44", - "shasum": "" + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1 || ^2" }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" + "replace": { + "malkusch/php-mock": "*" }, "require-dev": { - "mockery/mockery": "~1.3.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2020-08-15T11:14:08+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "e878a14a65245fbe78f8080eba03b47c3b705651" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e878a14a65245fbe78f8080eba03b47c3b705651", - "reference": "e878a14a65245fbe78f8080eba03b47c3b705651", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2020-06-27T10:12:23+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.10.3", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "451c3cd1418cf640de218914901e51b064abb093" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", - "reference": "451c3cd1418cf640de218914901e51b064abb093", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^2.5 || ^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2020-03-05T15:02:03+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "5.3.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "c89677919c5dd6d3b3852f230a663118762218ac" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", - "reference": "c89677919c5dd6d3b3852f230a663118762218ac", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": "^7.0", - "phpunit/php-file-iterator": "^1.4.2", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^2.0.1", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.0", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.0 || ^9.0" }, "suggest": { - "ext-xdebug": "^2.5.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2018-04-06T15:36:58+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2017-11-27T13:52:08+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.9", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2017-02-26T11:10:40+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "791198a2c6254db10131eecfe8c06670700904db" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", - "reference": "791198a2c6254db10131eecfe8c06670700904db", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.2.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2017-11-27T05:48:46+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "6.5.14", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bac23fe7ff13dbdb461481f706f0e9fe746334b7", - "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "myclabs/deep-copy": "^1.6.1", - "phar-io/manifest": "^1.0.1", - "phar-io/version": "^1.0", - "php": "^7.0", - "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^5.3", - "phpunit/php-file-iterator": "^1.4.3", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^1.0.9", - "phpunit/phpunit-mock-objects": "^5.0.9", - "sebastian/comparator": "^2.1", - "sebastian/diff": "^2.0", - "sebastian/environment": "^3.1", - "sebastian/exporter": "^3.1", - "sebastian/global-state": "^2.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^1.0", - "sebastian/version": "^2.0.1" - }, - "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2", - "phpunit/dbunit": "<3.0" - }, - "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-xdebug": "*", - "phpunit/php-invoker": "^1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.5.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2019-02-01T05:22:47+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "5.0.10", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", - "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.5", - "php": "^7.0", - "phpunit/php-text-template": "^1.2.1", - "sebastian/exporter": "^3.1" - }, - "conflict": { - "phpunit/phpunit": "<6.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.5.11" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "abandoned": true, - "time": "2018-08-09T05:50:03+00:00" - }, - { - "name": "psr/container", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "time": "2017-02-14T16:28:37+00:00" - }, - { - "name": "psr/event-dispatcher", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/event-dispatcher.git", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", - "shasum": "" - }, - "require": { - "php": ">=7.2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\EventDispatcher\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Standard interfaces for event handling.", - "keywords": [ - "events", - "psr", - "psr-14" - ], - "time": "2019-01-08T18:20:26+00:00" - }, - { - "name": "psr/log", - "version": "1.1.3", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "time": "2020-03-23T09:12:05+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^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": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" - }, - { - "name": "sebastian/comparator", - "version": "2.1.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", - "shasum": "" - }, - "require": { - "php": "^7.0", - "sebastian/diff": "^2.0 || ^3.0", - "sebastian/exporter": "^3.1" - }, - "require-dev": { - "phpunit/phpunit": "^6.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2018-02-01T13:46:46+00:00" - }, - { - "name": "sebastian/diff", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2017-08-03T08:09:46+00:00" - }, - { - "name": "sebastian/environment", - "version": "3.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1.x-dev" - } + "php-mock/php-mock-phpunit": "Allows integration into PHPUnit testcase with the trait PHPMock." }, + "type": "library", "autoload": { - "classmap": [ - "src/" - ] + "files": [ + "autoload.php" + ], + "psr-4": { + "phpmock\\": [ + "classes/", + "tests/" + ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "WTFPL" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Markus Malkusch", + "email": "markus@malkusch.de", + "homepage": "http://markus.malkusch.de", + "role": "Developer" } ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "description": "PHP-Mock can mock built-in PHP functions (e.g. time()). PHP-Mock relies on PHP's namespace fallback policy. No further extension is needed.", + "homepage": "https://github.com/php-mock/php-mock", "keywords": [ - "Xdebug", - "environment", - "hhvm" + "BDD", + "TDD", + "function", + "mock", + "stub", + "test", + "test double" ], - "time": "2017-07-01T08:51:00+00:00" + "time": "2020-04-17T16:39:00+00:00" }, { - "name": "sebastian/exporter", - "version": "3.1.2", + "name": "php-mock/php-mock-integration", + "version": "2.1.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" + "url": "https://github.com/php-mock/php-mock-integration.git", + "reference": "003d585841e435958a02e9b986953907b8b7609b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", - "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", + "url": "https://api.github.com/repos/php-mock/php-mock-integration/zipball/003d585841e435958a02e9b986953907b8b7609b", + "reference": "003d585841e435958a02e9b986953907b8b7609b", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/recursion-context": "^3.0" + "php": ">=5.6", + "php-mock/php-mock": "^2.2", + "phpunit/php-text-template": "^1 || ^2" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^5.7.27 || ^6 || ^7 || ^8 || ^9" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1.x-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "phpmock\\integration\\": "classes/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "WTFPL" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" + "name": "Markus Malkusch", + "email": "markus@malkusch.de", + "homepage": "http://markus.malkusch.de", + "role": "Developer" } ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", + "description": "Integration package for PHP-Mock", + "homepage": "https://github.com/php-mock/php-mock-integration", "keywords": [ - "export", - "exporter" + "BDD", + "TDD", + "function", + "mock", + "stub", + "test", + "test double" ], - "time": "2019-09-14T09:02:43+00:00" + "time": "2020-02-08T14:40:25+00:00" }, { - "name": "sebastian/global-state", - "version": "2.0.0", + "name": "php-mock/php-mock-mockery", + "version": "1.3.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + "url": "https://github.com/php-mock/php-mock-mockery.git", + "reference": "d6d3df9d9232f1623f1ca3cfdaacd53415593825" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "url": "https://api.github.com/repos/php-mock/php-mock-mockery/zipball/d6d3df9d9232f1623f1ca3cfdaacd53415593825", + "reference": "d6d3df9d9232f1623f1ca3cfdaacd53415593825", "shasum": "" }, "require": { - "php": "^7.0" + "mockery/mockery": "^1", + "php": ">=5.6", + "php-mock/php-mock-integration": "^2" }, "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "suggest": { - "ext-uopz": "*" + "phpunit/phpunit": "^4|^5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "phpmock\\mockery\\": "classes/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "WTFPL" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Markus Malkusch", + "email": "markus@malkusch.de", + "homepage": "http://markus.malkusch.de", + "role": "Developer" } ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "description": "Mock built-in PHP functions (e.g. time()) with Mockery. This package relies on PHP's namespace fallback policy. No further extension is needed.", + "homepage": "https://github.com/php-mock/php-mock-mockery", "keywords": [ - "global state" + "BDD", + "TDD", + "function", + "mock", + "mockery", + "stub", + "test", + "test double" ], - "time": "2017-04-27T15:39:26+00:00" + "time": "2018-03-27T07:00:25+00:00" }, { - "name": "sebastian/object-enumerator", - "version": "3.0.3", + "name": "phpunit/php-text-template", + "version": "2.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "6ff9c8ea4d3212b88fcf74e25e516e2c51c99324" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/6ff9c8ea4d3212b88fcf74e25e516e2c51c99324", + "reference": "6ff9c8ea4d3212b88fcf74e25e516e2c51c99324", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" + "php": "^7.3 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -2541,37 +1329,47 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" } ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-08-03T12:35:26+00:00" + "time": "2020-06-26T11:55:37+00:00" }, { - "name": "sebastian/object-reflector", - "version": "1.1.1", + "name": "phpunit/php-timer", + "version": "1.0.9", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "773f97c67f28de00d397be301821b06708fca0be" + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", - "reference": "773f97c67f28de00d397be301821b06708fca0be", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -2586,82 +1384,82 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sb@sebastian-bergmann.de", + "role": "lead" } ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2017-03-29T09:07:27+00:00" + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" }, { - "name": "sebastian/recursion-context", - "version": "3.0.0", + "name": "psr/container", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", "shasum": "" }, "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" + "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Psr\\Container\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2017-03-03T06:23:57+00:00" + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" }, { - "name": "sebastian/resource-operations", + "name": "psr/event-dispatcher", "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", "shasum": "" }, "require": { - "php": ">=5.6.0" + "php": ">=7.2.0" }, "type": "library", "extra": { @@ -2670,66 +1468,74 @@ } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "time": "2019-01-08T18:20:26+00:00" }, { - "name": "sebastian/version", - "version": "2.0.1", + "name": "psr/log", + "version": "1.1.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + "url": "https://github.com/php-fig/log.git", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2020-03-23T09:12:05+00:00" }, { "name": "symfony/console", @@ -3897,101 +2703,6 @@ } ], "time": "2020-05-20T17:43:50+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "75a63c33a8577608444246075ea0af0d052e452a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a", - "reference": "75a63c33a8577608444246075ea0af0d052e452a", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2020-07-12T23:59:07+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.9.1", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0 || ^8.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<3.9.1" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" - }, - "type": "library", - "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": "2020-07-08T17:02:28+00:00" } ], "aliases": [], diff --git a/wp-content/themes/theme/peridot.php b/wp-content/themes/theme/peridot.php index ed48965..b722946 100644 --- a/wp-content/themes/theme/peridot.php +++ b/wp-content/themes/theme/peridot.php @@ -1,7 +1,5 @@ helpersMock = Mockery::mock(\Dxw\Iguana\Theme\Helpers::class); + $this->helpersMock = \Mockery::mock(\Dxw\Iguana\Theme\Helpers::class); $this->templateTags = new \Theme\Lib\Whippet\TemplateTags( $this->helpersMock ); }); afterEach(function () { - \WP_Mock::tearDown(); + \Mockery::close(); }); describe('->w_template_title()', function () { diff --git a/wp-content/themes/theme/spec/posts/custom_fields.spec.php b/wp-content/themes/theme/spec/posts/custom_fields.spec.php index d6921db..505aa48 100644 --- a/wp-content/themes/theme/spec/posts/custom_fields.spec.php +++ b/wp-content/themes/theme/spec/posts/custom_fields.spec.php @@ -1,13 +1,16 @@ customFields = new \Theme\Posts\CustomFields(); }); afterEach(function () { - \WP_Mock::tearDown(); + \Mockery::close(); }); it('is registrable', function () { diff --git a/wp-content/themes/theme/spec/posts/post_types.spec.php b/wp-content/themes/theme/spec/posts/post_types.spec.php index 2517b7d..a8d3dda 100644 --- a/wp-content/themes/theme/spec/posts/post_types.spec.php +++ b/wp-content/themes/theme/spec/posts/post_types.spec.php @@ -1,13 +1,16 @@ postTypes = new \Theme\Posts\PostTypes(); }); afterEach(function () { - \WP_Mock::tearDown(); + \Mockery::close(); }); it('is registrable', function () { diff --git a/wp-content/themes/theme/spec/theme/analytics.spec.php b/wp-content/themes/theme/spec/theme/analytics.spec.php index c8aa121..d2df075 100644 --- a/wp-content/themes/theme/spec/theme/analytics.spec.php +++ b/wp-content/themes/theme/spec/theme/analytics.spec.php @@ -1,13 +1,16 @@ analytics = new \Theme\Theme\Analytics(); }); afterEach(function () { - \WP_Mock::tearDown(); + \Mockery::close(); }); it('is registrable', function () { @@ -16,7 +19,7 @@ describe('->register()', function () { it('registers actions', function () { - WP_Mock::expectActionAdded('wp_footer', [$this->analytics, 'wpFooter']); + PHPMockery::mock(__NAMESPACE__, 'add_action')->with('wp_footer', [$this->analytics, 'wpFooter'])->once(); $this->analytics->register(); }); }); diff --git a/wp-content/themes/theme/spec/theme/media.spec.php b/wp-content/themes/theme/spec/theme/media.spec.php index 37740a4..93fb419 100644 --- a/wp-content/themes/theme/spec/theme/media.spec.php +++ b/wp-content/themes/theme/spec/theme/media.spec.php @@ -1,13 +1,16 @@ media = new \Theme\Theme\Media(); }); afterEach(function () { - \WP_Mock::tearDown(); + \Mockery::close(); }); it('is registrable', function () { @@ -16,15 +19,9 @@ describe('->register()', function () { it('registers thumbnail sizes', function () { - \WP_Mock::wpFunction('set_post_thumbnail_size', [ - 'args' => [\WP_Mock\Functions::type('int'), \WP_Mock\Functions::type('int'), \WP_Mock\Functions::type('bool')], - 'times' => 1 - ]); - - \WP_Mock::wpFunction('add_image_size', [ - 'args' => [\WP_Mock\Functions::type('string'), \WP_Mock\Functions::type('int'), \WP_Mock\Functions::type('int'), \WP_Mock\Functions::type('bool')], - 'times' => 2 - ]); + PHPMockery::mock(__NAMESPACE__, 'set_post_thumbnail_size')->with(\Mockery::type('int'), \Mockery::type('int'), \Mockery::type('bool'))->times(1); + + PHPMockery::mock(__NAMESPACE__, 'add_image_size')->with(\Mockery::type('string'), \Mockery::type('int'), \Mockery::type('int'), \Mockery::type('bool'))->times(2); $this->media->register(); }); diff --git a/wp-content/themes/theme/spec/theme/menus.spec.php b/wp-content/themes/theme/spec/theme/menus.spec.php index 053504c..b69c14b 100644 --- a/wp-content/themes/theme/spec/theme/menus.spec.php +++ b/wp-content/themes/theme/spec/theme/menus.spec.php @@ -1,13 +1,16 @@ menus = new \Theme\Theme\Menus(); }); afterEach(function () { - \WP_Mock::tearDown(); + \Mockery::close(); }); it('is registrable', function () { @@ -16,10 +19,7 @@ describe('->register()', function () { it('registers nav menus', function () { - \WP_Mock::wpFunction('register_nav_menu', [ - 'args' => [\WP_Mock\Functions::type('string'), \WP_Mock\Functions::type('string')], - 'times' => 2 - ]); + PHPMockery::mock(__NAMESPACE__, 'register_nav_menu')->with(\Mockery::type('string'), \Mockery::type('string'))->times(2); $this->menus->register(); }); diff --git a/wp-content/themes/theme/spec/theme/pagination.spec.php b/wp-content/themes/theme/spec/theme/pagination.spec.php index 1257448..a0181f2 100644 --- a/wp-content/themes/theme/spec/theme/pagination.spec.php +++ b/wp-content/themes/theme/spec/theme/pagination.spec.php @@ -1,16 +1,16 @@ shouldReceive('registerFunction')->once(); $pagination = new \Theme\Theme\Pagination($helpersMock); }); diff --git a/wp-content/themes/theme/spec/theme/plugins.spec.php b/wp-content/themes/theme/spec/theme/plugins.spec.php index c517419..be7b0b6 100644 --- a/wp-content/themes/theme/spec/theme/plugins.spec.php +++ b/wp-content/themes/theme/spec/theme/plugins.spec.php @@ -1,20 +1,27 @@ function ($a) { - return '_'.$a.'_'; - }, - ]); + PHPMockery::mock(__NAMESPACE__, 'esc_html')->andReturnUsing(function ($a) { + return '_'.$a.'_'; + }); + PHPMockery::mock(__NAMESPACE__, 'apply_filters')->andReturnUsing(function ($a, $b) { + return $b; + }); if (!defined('WP_PLUGIN_DIR')) { define('WP_PLUGIN_DIR', '/path/to/plugins'); } + if (!defined('ABSPATH')) { + define('ABSPATH', '/abspath'); + } }); afterEach(function () { - \WP_Mock::tearDown(); + \Mockery::close(); }); it('is registrable', function () { @@ -25,43 +32,33 @@ describe('->register()', function () { it('registers theme activation hook', function () { $plugins = new \Theme\Theme\Plugins([]); - \WP_Mock::expectActionAdded('after_switch_theme', [$plugins, 'checkDependencies']); + PHPMockery::mock(__NAMESPACE__, 'add_action')->with('after_switch_theme', [$plugins, 'checkDependencies'])->once(); $plugins->register(); }); }); describe('->checkDependencies()', function () { it('flags any required plugins that aren\'t activated', function () { - WP_Mock::wpFunction('get_option', [ - 'args' => ['active_plugins'], - 'times' => 1, - 'return' => [ - 'some-other/plugin.php' - ] - ]); - WP_Mock::wpFunction('get_plugin_data', [ - 'args' => [WP_PLUGIN_DIR.'/path-to/a-required-plugin.php'], - 'times' => 1, - 'return' => [ - 'Name' => 'A plugin' - ] + PHPMockery::mock(__NAMESPACE__, 'get_option')->with('active_plugins')->times(1)->andReturn([ + 'some-other/plugin.php', ]); - WP_Mock::wpFunction('get_plugin_data', [ - 'args' => [WP_PLUGIN_DIR.'/advanced-custom-fields-pro/acf.php'], - 'times' => 1, - 'return' => [ - 'Name' => 'Advanced Custom Fields Pro' - ] + $getPluginData = PHPMockery::mock(__NAMESPACE__, 'get_plugin_data'); + $getPluginData->with(WP_PLUGIN_DIR.'/path-to/a-required-plugin.php')->times(1)->andReturn([ + 'Name' => 'A plugin', ]); - WP_Mock::wpFunction('admin_url', [ - 'args' => ['plugins.php'], - 'times' => 2, - 'return' => 'http://localhost/wp-admin/plugins.php' + $getPluginData->with(WP_PLUGIN_DIR.'/advanced-custom-fields-pro/acf.php')->times(1)->andReturn([ + 'Name' => 'Advanced Custom Fields Pro', ]); + PHPMockery::mock(__NAMESPACE__, 'admin_url')->with('plugins.php')->times(2)->andReturn('http://localhost/wp-admin/plugins.php'); $plugins = new \Theme\Theme\Plugins([ 'path-to/a-required-plugin.php', 'advanced-custom-fields-pro/acf.php' ]); + + // Prevent checkDependencies() from running require_once() + $plugins->requireOnce = function () { + }; + ob_start(); $plugins->checkDependencies(); $result = ob_get_contents(); @@ -76,19 +73,20 @@ context('when the plugins are already active', function () { it('doesn\'t print anything', function () { - WP_Mock::wpFunction('get_option', [ - 'args' => ['active_plugins'], - 'times' => 1, - 'return' => [ - 'some-other/plugin.php', - 'path-to/a-required-plugin.php', - 'advanced-custom-fields-pro/acf.php' - ] + PHPMockery::mock(__NAMESPACE__, 'get_option')->with('active_plugins')->times(1)->andReturn([ + 'some-other/plugin.php', + 'path-to/a-required-plugin.php', + 'advanced-custom-fields-pro/acf.php', ]); $plugins = new \Theme\Theme\Plugins([ 'path-to/a-required-plugin.php', 'advanced-custom-fields-pro/acf.php' ]); + + // Prevent checkDependencies() from running require_once() + $plugins->requireOnce = function () { + }; + ob_start(); $plugins->checkDependencies(); $result = ob_get_contents(); @@ -99,30 +97,23 @@ context('when there\'s no plugin data available', function () { it('displays the path of the plugin instead', function () { - WP_Mock::wpFunction('get_option', [ - 'args' => ['active_plugins'], - 'times' => 1, - 'return' => [ - 'some-other/plugin.php', - 'advanced-custom-fields-pro/acf.php' - ] + PHPMockery::mock(__NAMESPACE__, 'get_option')->with('active_plugins')->times(1)->andReturn([ + 'some-other/plugin.php', + 'advanced-custom-fields-pro/acf.php', ]); - WP_Mock::wpFunction('get_plugin_data', [ - 'args' => [WP_PLUGIN_DIR.'/path-to/a-required-plugin.php'], - 'times' => 1, - 'return' => [ - 'Name' => '' - ] - ]); - WP_Mock::wpFunction('admin_url', [ - 'args' => ['plugins.php'], - 'times' => 1, - 'return' => 'http://localhost/wp-admin/plugins.php' + PHPMockery::mock(__NAMESPACE__, 'get_plugin_data')->with(WP_PLUGIN_DIR.'/path-to/a-required-plugin.php')->times(1)->andReturn([ + 'Name' => '', ]); + PHPMockery::mock(__NAMESPACE__, 'admin_url')->with('plugins.php')->times(1)->andReturn('http://localhost/wp-admin/plugins.php'); $plugins = new \Theme\Theme\Plugins([ 'path-to/a-required-plugin.php', 'advanced-custom-fields-pro/acf.php' ]); + + // Prevent checkDependencies() from running require_once() + $plugins->requireOnce = function () { + }; + ob_start(); $plugins->checkDependencies(); $result = ob_get_contents(); diff --git a/wp-content/themes/theme/spec/theme/scripts.spec.php b/wp-content/themes/theme/spec/theme/scripts.spec.php index b2df3fb..0f919c8 100644 --- a/wp-content/themes/theme/spec/theme/scripts.spec.php +++ b/wp-content/themes/theme/spec/theme/scripts.spec.php @@ -1,19 +1,20 @@ function ($a) { - return '_'.$a.'_'; - }, - ]); + PHPMockery::mock(__NAMESPACE__, 'esc_url')->andReturnUsing(function ($a) { + return '_'.$a.'_'; + }); $this->helpers = new \Dxw\Iguana\Theme\Helpers(); $this->scripts = new \Theme\Theme\Scripts($this->helpers); }); afterEach(function () { - \WP_Mock::tearDown(); + \Mockery::close(); }); it('is registrable', function () { @@ -22,8 +23,9 @@ describe('->register()', function () { it('registers nav scripts', function () { - \WP_Mock::expectActionAdded('wp_enqueue_scripts', [$this->scripts, 'wpEnqueueScripts']); - \WP_Mock::expectActionAdded('wp_print_scripts', [$this->scripts, 'wpPrintScripts']); + $addAction = PHPMockery::mock(__NAMESPACE__, 'add_action'); + $addAction->with('wp_enqueue_scripts', [$this->scripts, 'wpEnqueueScripts'])->once(); + $addAction->with('wp_print_scripts', [$this->scripts, 'wpPrintScripts'])->once(); $this->scripts->register(); }); @@ -31,20 +33,14 @@ describe('->getAssetPath()', function () { it('gets the path of the assets', function () { - \WP_Mock::wpFunction('get_stylesheet_directory_uri', [ - 'args' => [], - 'return' => 'http://foo.bar.invalid/cat/dog' - ]); + PHPMockery::mock(__NAMESPACE__, 'get_stylesheet_directory_uri')->with()->andReturn('http://foo.bar.invalid/cat/dog'); expect($this->scripts->getAssetPath('meow'))->to->be->equal('http://foo.bar.invalid/cat/static/meow'); }); }); describe('->assetPath()', function () { it('echos the path of the assets', function () { - \WP_Mock::wpFunction('get_stylesheet_directory_uri', [ - 'args' => [], - 'return' => 'http://foo.bar.invalid/cat/dog', - ]); + PHPMockery::mock(__NAMESPACE__, 'get_stylesheet_directory_uri')->with()->andReturn('http://foo.bar.invalid/cat/dog'); ob_start(); $this->scripts->assetPath('meow'); $result = ob_get_contents(); @@ -55,35 +51,18 @@ describe('->wpEnqueueScripts()', function () { it('enqueues some of the JavaScript files', function () { - \WP_Mock::wpFunction('get_stylesheet_directory_uri', [ - 'args' => [], - 'return' => 'http://a.invalid/zzz', - ]); - - \WP_Mock::wpFunction('wp_deregister_script', [ - 'args' => ['jquery'], - 'times' => 1, - ]); - - \WP_Mock::wpFunction('wp_enqueue_script', [ - 'args' => ['jquery', 'http://a.invalid/static/lib/jquery.min.js'], - 'times' => 1, - ]); - - \WP_Mock::wpFunction('wp_enqueue_script', [ - 'args' => ['modernizr', 'http://a.invalid/static/lib/modernizr.min.js'], - 'times' => 1, - ]); - - \WP_Mock::wpFunction('wp_enqueue_script', [ - 'args' => ['main', 'http://a.invalid/static/main.min.js', ['jquery', 'modernizr'], '', true], - 'times' => 1, - ]); - - \WP_Mock::wpFunction('wp_enqueue_style', [ - 'args' => ['main', 'http://a.invalid/static/main.min.css'], - 'times' => 1, - ]); + PHPMockery::mock(__NAMESPACE__, 'get_stylesheet_directory_uri')->with()->andReturn('http://a.invalid/zzz'); + + PHPMockery::mock(__NAMESPACE__, 'wp_deregister_script')->with('jquery')->times(1); + + $wpEnqueueScript = PHPMockery::mock(__NAMESPACE__, 'wp_enqueue_script'); + $wpEnqueueScript->with('jquery', 'http://a.invalid/static/lib/jquery.min.js')->times(1); + + $wpEnqueueScript->with('modernizr', 'http://a.invalid/static/lib/modernizr.min.js')->times(1); + + $wpEnqueueScript->with('main', 'http://a.invalid/static/main.min.js', ['jquery', 'modernizr'], '', true)->times(1); + + PHPMockery::mock(__NAMESPACE__, 'wp_enqueue_style')->with('main', 'http://a.invalid/static/main.min.css')->times(1); $this->scripts->wpEnqueueScripts(); }); @@ -91,10 +70,7 @@ describe('->wpPrintScripts()', function () { it('prints some elements tags directly', function () { - \WP_Mock::wpFunction('get_stylesheet_directory_uri', [ - 'args' => [], - 'return' => 'http://a.invalid/zzz', - ]); + PHPMockery::mock(__NAMESPACE__, 'get_stylesheet_directory_uri')->with()->andReturn('http://a.invalid/zzz'); ob_start(); $this->scripts->wpPrintScripts(); $result = ob_get_contents(); diff --git a/wp-content/themes/theme/spec/theme/title_tag.spec.php b/wp-content/themes/theme/spec/theme/title_tag.spec.php index 2904770..4029c75 100644 --- a/wp-content/themes/theme/spec/theme/title_tag.spec.php +++ b/wp-content/themes/theme/spec/theme/title_tag.spec.php @@ -1,13 +1,16 @@ titleTag = new \Theme\Theme\TitleTag(); }); afterEach(function () { - \WP_Mock::tearDown(); + \Mockery::close(); }); it('is registrable', function () { @@ -16,10 +19,7 @@ describe('->register()', function () { it('adds support for title tag', function () { - \WP_Mock::wpFunction('add_theme_support', [ - 'args' => ['title-tag'], - 'times' => 1, - ]); + PHPMockery::mock(__NAMESPACE__, 'add_theme_support')->with('title-tag')->times(1); $this->titleTag->register(); }); }); diff --git a/wp-content/themes/theme/spec/theme/widgets.spec.php b/wp-content/themes/theme/spec/theme/widgets.spec.php index ee79a4e..4b5f080 100644 --- a/wp-content/themes/theme/spec/theme/widgets.spec.php +++ b/wp-content/themes/theme/spec/theme/widgets.spec.php @@ -1,13 +1,16 @@ widgets = new \Theme\Theme\Widgets(); }); afterEach(function () { - \WP_Mock::tearDown(); + \Mockery::close(); }); it('is registrable', function () { @@ -16,23 +19,18 @@ describe('->register()', function () { it('initialises the widgets', function () { - \WP_Mock::expectActionAdded('widgets_init', [$this->widgets, 'widgetsInit']); + PHPMockery::mock(__NAMESPACE__, 'add_action')->with('widgets_init', [$this->widgets, 'widgetsInit'])->once(); $this->widgets->register(); }); }); describe('->widgetsInit()', function () { it('registers any widgets in the theme ', function () { - \WP_Mock::wpFunction('__', [ - 'return' => function ($a) { - return $a; - } - ]); - - \WP_Mock::wpFunction('register_sidebar', [ - 'args' => [\WP_Mock\Functions::type('array')], - 'times' => 2, - ]); + PHPMockery::mock(__NAMESPACE__, '__')->andReturnUsing(function ($a) { + return $a; + }); + + PHPMockery::mock(__NAMESPACE__, 'register_sidebar')->with(\Mockery::type('array'))->times(2); $this->widgets->widgetsInit(); }); diff --git a/wp-content/themes/theme/spec/theme/wp_head.spec.php b/wp-content/themes/theme/spec/theme/wp_head.spec.php index 805844d..f3953e8 100644 --- a/wp-content/themes/theme/spec/theme/wp_head.spec.php +++ b/wp-content/themes/theme/spec/theme/wp_head.spec.php @@ -1,13 +1,16 @@ wpHead = new \Theme\Theme\WpHead(); }); afterEach(function () { - \WP_Mock::tearDown(); + \Mockery::close(); }); it('is registrable', function () { @@ -16,7 +19,7 @@ describe('->register()', function () { it('adds actions', function () { - \WP_Mock::expectActionAdded('init', [$this->wpHead, 'init']); + PHPMockery::mock(__NAMESPACE__, 'add_action')->with('init', [$this->wpHead, 'init'])->once(); $this->wpHead->register(); }); }); @@ -37,11 +40,9 @@ ['wp_head', 'adjacent_posts_rel_link', 10, 0], ]; + $removeAction = PHPMockery::mock(__NAMESPACE__, 'remove_action'); foreach ($actions as $args) { - \WP_Mock::wpFunction('remove_action', [ - 'args' => $args, - 'times' => 1 - ]); + $removeAction->with(...$args)->times(1); } $this->wpHead->init(); }); diff --git a/wp-content/themes/theme/vendor.phar b/wp-content/themes/theme/vendor.phar index dc8b9777cc2ec465f27452ebc884ad8cc659d219..60c0bd6e2d6ac1efbbbe70b0142821bfc2e0de8b 100644 GIT binary patch delta 1225 zcma)5TSydP6#i#+_BJ~^dzn?&%+gFrHfpn7*Iln`Uh+-`J{YCD?idwjw+9IWNys9E zhCeMRYC|$BAz9Lif*yK^q6hP>Ktt#uAu=R{9-XrAej}AOY&evRU)t~*f7`H8 zl^s{TqzQHRpT4WCNi=TX3L3BM4S=EpYg!$+)Tje%=aaGM^a3yJL|=1^gsfXUv$WBf zPp6#%9KLV{VB+>nLO#!iqTuOO$xJs%5)iyn84#Wr2+4TNhUtKW*EJ)d7eAz(KuBoU z_T1--4|`lA9v7oMtoGv!( wQuz`J9hJ{D_eWy#nH`0td}3LdP=vf+fBaXzyd56Rk^A@s?e8G<)h*S30aPrg-2eap delta 1225 zcma)5TSydP6#i#+_P#rNnbp=?YPFJV)LvZIT`%iyUh+;B21dDFcEif-21yu5kp>~O z{H20oMr3M2BIyJ{4?Tp`gZWmWQA8j_hJ?^lG@i5cx;+fvob!L@JLi1=%-WP?ZOU>d zS?Th69c_8OSVsE4*U~Oo_>Dg{=K)wR+ypGk1CM(byUPF61 zGZ14O7OZeMlu?e&12RI??;{?Xt=L8T`W`qv2e8-U0d@EZvjuwh?3erdpK{A0jI zrAAz}UlIy;U$`IJ6zGI86Et2Ks{nZu*3_GDsX-IgF2`fu>;PWSjJ{?m2}!RS*`U>C z8=W=l;P8dn3lle{5b|}w-v*xE7SuFV5P;wiih%G`LCEOGV^?U8fY&uApclV{eL$F( zu5G-3?8^q=%IrnP|6gwuvlvThtwC_jw}`M|(8i?Q%JsPDg>q=WO*weI932 zJpYVaW)jkdTNb(L|6(PH#Ud9>tSF8@=d4E(N>bykB=NgeULsFO9j-FT>l3m>(Ih|4 y)+F-9?>`l}T-)8+5xKZGw@?#a`nHuCx_S2KbZ4e5ZN~M))>$b19i%c;7y1i+V}*