From efc7b84f3f2d127ced3fa3328c68f5d9eb5826c2 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 29 Mar 2024 09:46:54 +0200 Subject: [PATCH] Use "console-helpers/prophecy-phpunit" fork --- composer.json | 3 +- composer.lock | 79 ++++++++++++++++--- tests/ConsoleKit/AbstractTestCase.php | 22 ++++++ tests/ConsoleKit/ConsoleIOTest.php | 3 +- tests/ConsoleKit/ContainerTest.php | 3 +- .../ConsoleKit/Helper/ContainerHelperTest.php | 4 +- .../WorkingDirectoryAwareTestCase.php | 3 +- 7 files changed, 95 insertions(+), 22 deletions(-) create mode 100644 tests/ConsoleKit/AbstractTestCase.php diff --git a/composer.json b/composer.json index e47c863..d8ab34b 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,8 @@ "require-dev": { "aik099/coding-standard": "dev-master", "yoast/phpunit-polyfills": "^1.0", - "phpspec/prophecy": "^1.10" + "phpspec/prophecy": "^1.10", + "console-helpers/prophecy-phpunit": "^2.0@dev" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 3bfa470..7021913 100644 --- a/composer.lock +++ b/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": "c55443d1d13105fa341ed4079a0c7b02", + "content-hash": "c1d20a17f5f8d2d4c8e8353504b499bb", "packages": [ { "name": "pimple/pimple", @@ -493,6 +493,58 @@ }, "time": "2021-11-07T16:55:51+00:00" }, + { + "name": "console-helpers/prophecy-phpunit", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/console-helpers/prophecy-phpunit.git", + "reference": "adc1cfa8dc05f42f9b5269775090ec8efdcbe2aa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/console-helpers/prophecy-phpunit/zipball/adc1cfa8dc05f42f9b5269775090ec8efdcbe2aa", + "reference": "adc1cfa8dc05f42f9b5269775090ec8efdcbe2aa", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7 || ^8", + "phpspec/prophecy": "^1.3", + "phpunit/phpunit": "^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0" + }, + "default-branch": true, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\PhpUnit\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christophe Coevoet", + "email": "stof@notk.org" + } + ], + "description": "Integrating the Prophecy mocking library in PHPUnit test cases", + "homepage": "http://phpspec.net", + "keywords": [ + "phpunit", + "prophecy" + ], + "support": { + "source": "https://github.com/console-helpers/prophecy-phpunit/tree/master" + }, + "time": "2024-03-28T08:54:24+00:00" + }, { "name": "doctrine/instantiator", "version": "1.0.5", @@ -1264,16 +1316,16 @@ }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.2", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619" + "reference": "92a1a52e86d34cde6caa54f1b5ffa9fda18e5d54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/92a1a52e86d34cde6caa54f1b5ffa9fda18e5d54", + "reference": "92a1a52e86d34cde6caa54f1b5ffa9fda18e5d54", "shasum": "" }, "require": { @@ -1307,7 +1359,7 @@ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "support": { "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2" + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.3" }, "funding": [ { @@ -1315,7 +1367,7 @@ "type": "github" } ], - "time": "2020-11-30T08:15:22+00:00" + "time": "2024-03-01T13:45:45+00:00" }, { "name": "sebastian/comparator", @@ -2026,16 +2078,16 @@ }, { "name": "yoast/phpunit-polyfills", - "version": "1.0.5", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/Yoast/PHPUnit-Polyfills.git", - "reference": "3b59adeef77fb1c03ff5381dbb9d68b0aaff3171" + "reference": "224e4a1329c03d8bad520e3fc4ec980034a4b212" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/3b59adeef77fb1c03ff5381dbb9d68b0aaff3171", - "reference": "3b59adeef77fb1c03ff5381dbb9d68b0aaff3171", + "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/224e4a1329c03d8bad520e3fc4ec980034a4b212", + "reference": "224e4a1329c03d8bad520e3fc4ec980034a4b212", "shasum": "" }, "require": { @@ -2082,13 +2134,14 @@ "issues": "https://github.com/Yoast/PHPUnit-Polyfills/issues", "source": "https://github.com/Yoast/PHPUnit-Polyfills" }, - "time": "2023-03-30T23:39:05+00:00" + "time": "2023-08-19T14:25:08+00:00" } ], "aliases": [], "minimum-stability": "stable", "stability-flags": { - "aik099/coding-standard": 20 + "aik099/coding-standard": 20, + "console-helpers/prophecy-phpunit": 20 }, "prefer-stable": false, "prefer-lowest": false, diff --git a/tests/ConsoleKit/AbstractTestCase.php b/tests/ConsoleKit/AbstractTestCase.php new file mode 100644 index 0000000..ab25ff6 --- /dev/null +++ b/tests/ConsoleKit/AbstractTestCase.php @@ -0,0 +1,22 @@ + + * @link https://github.com/console-helpers/console-kit + */ + +namespace Tests\ConsoleHelpers\ConsoleKit; + + +use PHPUnit\Framework\TestCase; +use Prophecy\PhpUnit\ProphecyTrait; + +abstract class AbstractTestCase extends TestCase +{ + + use ProphecyTrait; + +} diff --git a/tests/ConsoleKit/ConsoleIOTest.php b/tests/ConsoleKit/ConsoleIOTest.php index 40b2eff..07d8212 100644 --- a/tests/ConsoleKit/ConsoleIOTest.php +++ b/tests/ConsoleKit/ConsoleIOTest.php @@ -12,14 +12,13 @@ use ConsoleHelpers\ConsoleKit\ConsoleIO; -use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\Prophecy\ObjectProphecy; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ChoiceQuestion; use Symfony\Component\Console\Question\ConfirmationQuestion; -class ConsoleIOTest extends TestCase +class ConsoleIOTest extends AbstractTestCase { /** diff --git a/tests/ConsoleKit/ContainerTest.php b/tests/ConsoleKit/ContainerTest.php index f05387c..7abb1b5 100644 --- a/tests/ConsoleKit/ContainerTest.php +++ b/tests/ConsoleKit/ContainerTest.php @@ -12,9 +12,8 @@ use ConsoleHelpers\ConsoleKit\Container; -use PHPUnit\Framework\TestCase; -class ContainerTest extends TestCase +class ContainerTest extends AbstractTestCase { /** diff --git a/tests/ConsoleKit/Helper/ContainerHelperTest.php b/tests/ConsoleKit/Helper/ContainerHelperTest.php index ec0512b..d8ad3dd 100644 --- a/tests/ConsoleKit/Helper/ContainerHelperTest.php +++ b/tests/ConsoleKit/Helper/ContainerHelperTest.php @@ -13,9 +13,9 @@ use ConsoleHelpers\ConsoleKit\Helper\ContainerHelper; use ConsoleHelpers\ConsoleKit\Container; -use PHPUnit\Framework\TestCase; +use Tests\ConsoleHelpers\ConsoleKit\AbstractTestCase; -class ContainerHelperTest extends TestCase +class ContainerHelperTest extends AbstractTestCase { /** diff --git a/tests/ConsoleKit/WorkingDirectoryAwareTestCase.php b/tests/ConsoleKit/WorkingDirectoryAwareTestCase.php index 09a21f5..c9d037d 100644 --- a/tests/ConsoleKit/WorkingDirectoryAwareTestCase.php +++ b/tests/ConsoleKit/WorkingDirectoryAwareTestCase.php @@ -12,9 +12,8 @@ use ConsoleHelpers\ConsoleKit\WorkingDirectory; -use PHPUnit\Framework\TestCase; -abstract class WorkingDirectoryAwareTestCase extends TestCase +abstract class WorkingDirectoryAwareTestCase extends AbstractTestCase { /**