From 0b68bdc9e29ed20856034952861db58838b019f8 Mon Sep 17 00:00:00 2001 From: Cees-Jan Kiewiet Date: Thu, 8 Dec 2016 08:01:48 +0100 Subject: [PATCH] Removed humbug, updated some small thing up to specs --- Makefile | 3 - composer.json | 5 - composer.lock | 673 +---------------------------------------- src/TestCase.php | 4 +- tests/TestCaseTest.php | 20 +- 5 files changed, 15 insertions(+), 690 deletions(-) diff --git a/Makefile b/Makefile index 210fb25..43b2b32 100644 --- a/Makefile +++ b/Makefile @@ -28,8 +28,5 @@ unit-coverage: ci-coverage: init composer ci-coverage -mutation: - composer mutation - generate-test-resources: init ./api-client-resource-generator ./tests/yaml/* ./tests/resources-src/ ./tests/resources-tests diff --git a/composer.json b/composer.json index 4f46911..1d67d03 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,6 @@ "require": { "php": "^7.0", "clue/block-react": "^1.1", - "humbug/humbug": "1.0.0-alpha2", "jakub-onderka/php-console-highlighter": "^0.3.2", "jakub-onderka/php-parallel-lint": "^0.9.2", "phake/phake": "^2.3", @@ -47,10 +46,6 @@ "@ensure-installed", "phpunit --colors=always -c phpunit.xml.dist --coverage-text --coverage-html covHtml --coverage-clover ./build/logs/clover.xml" ], - "mutation": [ - "@ensure-installed", - "if [ `php -m | grep xdebug | wc -l` -gt 0 ]; then humbug --ansi --incremental; fi" - ], "lint-php": [ "@ensure-installed", "parallel-lint --exclude vendor ." diff --git a/composer.lock b/composer.lock index e1d09ae..370693a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "b0a389f6be47a7ff18afa24c29d36be2", - "content-hash": "3b7df16da3ee271be5e09468ae133008", + "hash": "393c5970e4f28ca5b57c9d35a968578a", + "content-hash": "a5a5f9238f769dd6206fa7a3a1a2c275", "packages": [ { "name": "clue/block-react", @@ -109,73 +109,6 @@ ], "time": "2015-06-14 21:17:01" }, - { - "name": "humbug/humbug", - "version": "1.0.0-alpha2", - "source": { - "type": "git", - "url": "https://github.com/padraic/humbug.git", - "reference": "06b1c059e432dab8c22c36bc8b6e1ffc7e587c07" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/padraic/humbug/zipball/06b1c059e432dab8c22c36bc8b6e1ffc7e587c07", - "reference": "06b1c059e432dab8c22c36bc8b6e1ffc7e587c07", - "shasum": "" - }, - "require": { - "padraic/phar-updater": "^1.0.0", - "padraic/phpunit-accelerator": "^1.0.2", - "padraic/phpunit-extensions": "^1.0.0", - "php": ">=5.4.0", - "phpunit/phpunit": "^4.5|^5.0", - "sebastian/diff": "^1.1", - "symfony/console": "^2.6|^3.0", - "symfony/event-dispatcher": "^2.6|^3.0", - "symfony/finder": "^2.6|^3.0", - "symfony/process": "^2.6|^3.0" - }, - "require-dev": { - "behat/behat": "^3.0.15", - "mikey179/vfsstream": "^1.4", - "mockery/mockery": "^0.9", - "symfony/filesystem": "^2.6|^3.0" - }, - "bin": [ - "bin/humbug" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "Humbug\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Pádraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - } - ], - "description": "Humbug is a Mutation Testing framework for PHP. Whereas Code Coverage can tell you what code your tests are executing, Mutation Testing is intended to help you judge how well your unit tests actually perform and where they could be improved.", - "homepage": "https://github.com/padraic/humbug", - "keywords": [ - "coverage", - "mutation testing", - "testing", - "unit testing" - ], - "time": "2016-08-01 10:27:00" - }, { "name": "jakub-onderka/php-console-color", "version": "0.1", @@ -352,220 +285,6 @@ ], "time": "2016-10-31 17:19:45" }, - { - "name": "padraic/humbug_get_contents", - "version": "1.0.4", - "source": { - "type": "git", - "url": "https://github.com/padraic/file_get_contents.git", - "reference": "66797199019d0cb4529cb8d29c6f0b4c5085b53a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/padraic/file_get_contents/zipball/66797199019d0cb4529cb8d29c6f0b4c5085b53a", - "reference": "66797199019d0cb4529cb8d29c6f0b4c5085b53a", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "Humbug\\": "src/Humbug/" - }, - "files": [ - "src/function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Pádraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - } - ], - "description": "Secure wrapper for accessing HTTPS resources with file_get_contents for PHP 5.3+", - "homepage": "https://github.com/padraic/file_get_contents", - "keywords": [ - "download", - "file_get_contents", - "http", - "https", - "ssl", - "tls" - ], - "time": "2015-04-22 18:45:00" - }, - { - "name": "padraic/phar-updater", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/padraic/phar-updater.git", - "reference": "c17eeb3887dc4269d1b4837dc875d39e9f8149a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/padraic/phar-updater/zipball/c17eeb3887dc4269d1b4837dc875d39e9f8149a8", - "reference": "c17eeb3887dc4269d1b4837dc875d39e9f8149a8", - "shasum": "" - }, - "require": { - "padraic/humbug_get_contents": "^1.0", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "Humbug\\SelfUpdate\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Pádraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - } - ], - "description": "A thing to make PHAR self-updating easy and secure.", - "keywords": [ - "humbug", - "phar", - "self-update", - "update" - ], - "time": "2016-01-05 23:08:01" - }, - { - "name": "padraic/phpunit-accelerator", - "version": "v1.0.2", - "source": { - "type": "git", - "url": "https://github.com/padraic/phpunit-accelerator.git", - "reference": "0b3b58e6e9a794eec22df712776058850d5fe0c1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/padraic/phpunit-accelerator/zipball/0b3b58e6e9a794eec22df712776058850d5fe0c1", - "reference": "0b3b58e6e9a794eec22df712776058850d5fe0c1", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "phpunit/phpunit": ">=3.7" - }, - "replace": { - "mybuilder/phpunit-accelerator": "1.0.x" - }, - "type": "library", - "autoload": { - "psr-4": { - "MyBuilder\\PhpunitAccelerator\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Keyvan Akbary", - "email": "keyvan@mybuilder.com", - "role": "Developer" - }, - { - "name": "Padraic Brady", - "email": "padraic.brady@gmail.com", - "role": "Contributor" - } - ], - "description": "PHPUnit Accelerator: Speeds up PHPUnit by freeing memory after test runs", - "keywords": [ - "accelerator", - "fast", - "free", - "memory", - "phpunit", - "property" - ], - "time": "2015-01-15 21:18:21" - }, - { - "name": "padraic/phpunit-extensions", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/padraic/phpunit-extensions.git", - "reference": "a6942fa3ada5487e1b9a409c235013a677c2689b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/padraic/phpunit-extensions/zipball/a6942fa3ada5487e1b9a409c235013a677c2689b", - "reference": "a6942fa3ada5487e1b9a409c235013a677c2689b", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "phpunit/phpunit": "^4.0|^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-0": { - "Humbug\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Pádraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - } - ], - "description": "Collection of Listeners to log and manipulate test run order", - "keywords": [ - "extension", - "humbug", - "listener", - "phpunit", - "testing", - "tests" - ], - "time": "2016-01-06 12:16:20" - }, { "name": "phake/phake", "version": "v2.3.0", @@ -1218,53 +937,6 @@ ], "time": "2016-11-27 07:52:03" }, - { - "name": "psr/log", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.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": "2016-10-10 12:19:37" - }, { "name": "react/event-loop", "version": "v0.4.2", @@ -1994,343 +1666,6 @@ ], "time": "2016-11-30 04:02:31" }, - { - "name": "symfony/console", - "version": "v3.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "09d0fd33560e3573185a2ea17614e37ba38716c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/09d0fd33560e3573185a2ea17614e37ba38716c5", - "reference": "09d0fd33560e3573185a2ea17614e37ba38716c5", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/debug": "~2.8|~3.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/filesystem": "~2.8|~3.0", - "symfony/process": "~2.8|~3.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/filesystem": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2016-11-16 22:18:16" - }, - { - "name": "symfony/debug", - "version": "v3.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "9f923e68d524a3095c5a2ae5fc7220c7cbc12231" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/9f923e68d524a3095c5a2ae5fc7220c7cbc12231", - "reference": "9f923e68d524a3095c5a2ae5fc7220c7cbc12231", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" - }, - "require-dev": { - "symfony/class-loader": "~2.8|~3.0", - "symfony/http-kernel": "~2.8|~3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Debug Component", - "homepage": "https://symfony.com", - "time": "2016-11-16 22:18:16" - }, - { - "name": "symfony/event-dispatcher", - "version": "v3.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "e8f47a327c2f0fd5aa04fa60af2b693006ed7283" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/e8f47a327c2f0fd5aa04fa60af2b693006ed7283", - "reference": "e8f47a327c2f0fd5aa04fa60af2b693006ed7283", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0", - "symfony/dependency-injection": "~2.8|~3.0", - "symfony/expression-language": "~2.8|~3.0", - "symfony/stopwatch": "~2.8|~3.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2016-10-13 06:29:04" - }, - { - "name": "symfony/finder", - "version": "v3.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "4263e35a1e342a0f195c9349c0dee38148f8a14f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/4263e35a1e342a0f195c9349c0dee38148f8a14f", - "reference": "4263e35a1e342a0f195c9349c0dee38148f8a14f", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2016-11-03 08:11:03" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.3.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "time": "2016-11-14 01:06:16" - }, - { - "name": "symfony/process", - "version": "v3.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "02ea84847aad71be7e32056408bb19f3a616cdd3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/02ea84847aad71be7e32056408bb19f3a616cdd3", - "reference": "02ea84847aad71be7e32056408bb19f3a616cdd3", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Process Component", - "homepage": "https://symfony.com", - "time": "2016-11-24 10:40:28" - }, { "name": "symfony/yaml", "version": "v3.2.0", @@ -2440,9 +1775,7 @@ "packages-dev": [], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "humbug/humbug": 15 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/src/TestCase.php b/src/TestCase.php index a4ec71d..071d01b 100644 --- a/src/TestCase.php +++ b/src/TestCase.php @@ -3,7 +3,7 @@ namespace ApiClients\Tools\TestUtilities; use FilesystemIterator; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase as PHPUnitTestCase; use React\EventLoop\Factory; use React\EventLoop\LoopInterface; use React\Promise\PromiseInterface; @@ -13,7 +13,7 @@ use function Clue\React\Block\awaitAll; use function Clue\React\Block\awaitAny; -abstract class TestCase extends PHPUnit_Framework_TestCase +abstract class TestCase extends PHPUnitTestCase { /** * @var string diff --git a/tests/TestCaseTest.php b/tests/TestCaseTest.php index 4e8b703..d978615 100644 --- a/tests/TestCaseTest.php +++ b/tests/TestCaseTest.php @@ -21,7 +21,7 @@ public function provideTemporaryDirectory() { for ($i = 0; $i <= self::PENTIUM; $i++) { yield [ - (string) mt_rand($i * $i, mt_getrandmax()), + (string) random_int($i * $i, PHP_INT_MAX), ]; } } @@ -35,7 +35,7 @@ public function provideEventLoop() public function testRecursiveDirectoryCreation() { - $this->assertFileExists($this->getTmpDir()); + static::assertFileExists($this->getTmpDir()); } /** @@ -43,20 +43,20 @@ public function testRecursiveDirectoryCreation() */ public function testTemporaryDirectoryAndGetFilesInDirectory(string $int) { - $this->assertNotSame($this->getTmpDir(), $this->previousTemporaryDirectory); + static::assertNotSame($this->getTmpDir(), $this->previousTemporaryDirectory); $dir = $this->getTmpDir() . $this->getRandomNameSpace() . DIRECTORY_SEPARATOR; mkdir($dir); for ($i = 0; $i < self::PENTIUM; $i++) { - $this->assertSame($i, count($this->getFilesInDirectory($this->getTmpDir())), $i); + static::assertCount($i, $this->getFilesInDirectory($this->getTmpDir()), $i); file_put_contents($dir . $i, $int); } - $this->assertSame(self::PENTIUM, count($this->getFilesInDirectory($this->getTmpDir()))); + static::assertCount(self::PENTIUM, $this->getFilesInDirectory($this->getTmpDir())); foreach ($this->getFilesInDirectory($this->getTmpDir()) as $file) { - $this->assertSame($int, file_get_contents($file)); + static::assertSame($int, file_get_contents($file)); } } @@ -66,7 +66,7 @@ public function testTemporaryDirectoryAndGetFilesInDirectory(string $int) public function testAwait(LoopInterface $loop = null) { $value = time(); - $this->assertSame($value, $this->await(resolve($value), $loop)); + static::assertSame($value, $this->await(resolve($value), $loop)); } /** @@ -75,7 +75,7 @@ public function testAwait(LoopInterface $loop = null) public function testAwaitAll(LoopInterface $loop = null) { $value = time(); - $this->assertSame([$value, $value], $this->awaitAll([resolve($value), resolve($value)], $loop)); + static::assertSame([$value, $value], $this->awaitAll([resolve($value), resolve($value)], $loop)); } /** @@ -84,7 +84,7 @@ public function testAwaitAll(LoopInterface $loop = null) public function testAwaitAny(LoopInterface $loop = null) { $value = time(); - $this->assertSame($value, $this->awaitAny([resolve($value), resolve($value)], $loop)); + static::assertSame($value, $this->awaitAny([resolve($value), resolve($value)], $loop)); } /** @@ -92,6 +92,6 @@ public function testAwaitAny(LoopInterface $loop = null) */ public function testTrueFalse(bool $bool) { - $this->assertInternalType('bool', $bool); + static::assertInternalType('bool', $bool); } }