From 0f8ac7995f8f7e996fe748478b2a4437baab0c2a Mon Sep 17 00:00:00 2001 From: Daniels Date: Wed, 10 Nov 2021 17:50:09 +0200 Subject: [PATCH 01/11] Made Unit tests for step 1 --- .gitignore | 3 + .phpunit.result.cache | 1 + app/FooBar.php | 11 + composer.json | 10 + composer.lock | 2112 +++++++++++++++++++++++++++++++++++++++++ tests/FooBarTest.php | 36 + 6 files changed, 2173 insertions(+) create mode 100644 .gitignore create mode 100644 .phpunit.result.cache create mode 100644 app/FooBar.php create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 tests/FooBarTest.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..4a06c5ef --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.idea/ +vendor/ +.phpunit.result.cache/ \ No newline at end of file diff --git a/.phpunit.result.cache b/.phpunit.result.cache new file mode 100644 index 00000000..679a6d97 --- /dev/null +++ b/.phpunit.result.cache @@ -0,0 +1 @@ +{"version":1,"defects":{"FooBarTest::test_is_result_foo":4,"FooBarTest::test_is_result_bar":4,"FooBarTest::test_is_result_foo_bar":4},"times":{"FooBarTest::test_is_result_foo":0.001,"FooBarTest::test_is_result_bar":0,"FooBarTest::test_is_result_foo_bar":0}} \ No newline at end of file diff --git a/app/FooBar.php b/app/FooBar.php new file mode 100644 index 00000000..b56daadb --- /dev/null +++ b/app/FooBar.php @@ -0,0 +1,11 @@ +=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.1" + }, + "time": "2021-11-03T20:52:16+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.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)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "bae7c545bef187884426f042434e561ab1ddb182" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", + "shasum": "" + }, + "require": { + "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" + }, + { + "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", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.1.0" + }, + "time": "2021-02-23T14:00:09+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "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" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" + }, + "require-dev": { + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" + }, + "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.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + }, + "time": "2021-10-19T17:43:47+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "*", + "psalm/phar": "^4.8" + }, + "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", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" + }, + "time": "2021-10-02T14:08:47+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.14.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.2", + "php": "^7.2 || ~8.0, <8.2", + "phpdocumentor/reflection-docblock": "^5.2", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^6.0 || ^7.0", + "phpunit/phpunit": "^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.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" + ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/1.14.0" + }, + "time": "2021-09-10T09:02:12+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "cf04e88a2e3c56fc1a65488afd493325b4c1bc3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/cf04e88a2e3c56fc1a65488afd493325b4c1bc3e", + "reference": "cf04e88a2e3c56fc1a65488afd493325b4c1bc3e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.13.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "*", + "ext-xdebug": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.2-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" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-10-30T08:01:38+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8", + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-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": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:57:25+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-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": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "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", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-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": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.5.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c814a05837f2edb0d1471d6e3f4ab3501ca3899a", + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpspec/prophecy": "^1.12.1", + "phpunit/php-code-coverage": "^9.2.7", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.5", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.3", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^2.3.4", + "sebastian/version": "^3.0.2" + }, + "require-dev": { + "ext-pdo": "*", + "phpspec/prophecy-phpunit": "^2.0.1" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.5-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ], + "files": [ + "src/Framework/Assert/Functions.php" + ] + }, + "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" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.10" + }, + "funding": [ + { + "url": "https://phpunit.de/donate.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-09-25T07:38:51+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "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": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "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": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "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": "Looks up which function or method a line of code belongs to", + "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/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:49:45+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "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", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:10:38+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:52:38+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65", + "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "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" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:24:23+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-11T13:31:12+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.6", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "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": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "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": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:17:30+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" + }, + { + "name": "sebastian/type", + "version": "2.3.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-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": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-15T12:49:02+00:00" + }, + { + "name": "sebastian/version", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-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 helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "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", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2021-07-28T10:34:58+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.10.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.10.0" + }, + "time": "2021-03-09T10:59:23+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.1.0" +} diff --git a/tests/FooBarTest.php b/tests/FooBarTest.php new file mode 100644 index 00000000..43192388 --- /dev/null +++ b/tests/FooBarTest.php @@ -0,0 +1,36 @@ +assertEquals($result, $this->fooBar->numberText(3)); + $this->assertEquals($result, $this->fooBar->numberText(6)); + $this->assertEquals($result, $this->fooBar->numberText(12)); + } + + public function test_is_result_bar() + { + $result = 'Bar'; + + $this->assertEquals($result, $this->fooBar->numberText(5)); + $this->assertEquals($result, $this->fooBar->numberText(10)); + $this->assertEquals($result, $this->fooBar->numberText(25)); + } + + public function test_is_result_foo_bar() + { + $result = 'Foo, Bar'; + + $this->assertEquals($result, $this->fooBar->numberText(15)); + $this->assertEquals($result, $this->fooBar->numberText(30)); + $this->assertEquals($result, $this->fooBar->numberText(90)); + } +} \ No newline at end of file From 87fed1a044e26c3cb17a07a32eb03e150d6ea35b Mon Sep 17 00:00:00 2001 From: Daniels Date: Thu, 11 Nov 2021 11:53:35 +0200 Subject: [PATCH 02/11] Wrote implementation for step 1 and modified tests --- .phpunit.result.cache | 2 +- app/FooBar.php | 17 ++++++++++++++++- composer.json | 3 +++ index.php | 12 ++++++++++++ tests/FooBarTest.php | 20 +++++++++----------- 5 files changed, 41 insertions(+), 13 deletions(-) create mode 100644 index.php diff --git a/.phpunit.result.cache b/.phpunit.result.cache index 679a6d97..551df692 100644 --- a/.phpunit.result.cache +++ b/.phpunit.result.cache @@ -1 +1 @@ -{"version":1,"defects":{"FooBarTest::test_is_result_foo":4,"FooBarTest::test_is_result_bar":4,"FooBarTest::test_is_result_foo_bar":4},"times":{"FooBarTest::test_is_result_foo":0.001,"FooBarTest::test_is_result_bar":0,"FooBarTest::test_is_result_foo_bar":0}} \ No newline at end of file +{"version":1,"defects":{"FooBarTest::test_is_result_foo":4,"FooBarTest::test_is_result_bar":4,"FooBarTest::test_is_result_foo_bar":4},"times":{"FooBarTest::test_is_result_foo":0.02,"FooBarTest::test_is_result_bar":0,"FooBarTest::test_is_result_foo_bar":0}} \ No newline at end of file diff --git a/app/FooBar.php b/app/FooBar.php index b56daadb..9d4452eb 100644 --- a/app/FooBar.php +++ b/app/FooBar.php @@ -4,8 +4,23 @@ class FooBar { - public function numberText(): string + private string $multipleOfThree; + private string $multipleOfFive; + + public function __construct(string $multipleOfThree, string $multipleOfFive) { + $this->multipleOfThree = $multipleOfThree; + $this->multipleOfFive = $multipleOfFive; + } + public function numberText(int $number): string + { + if ($number % 5 == 0 && $number % 3 == 0) { + return "{$this->multipleOfThree}, {$this->multipleOfFive}"; + } else if ($number % 3 == 0) { + return $this->multipleOfThree; + } else { + return $this->multipleOfFive; + } } } \ No newline at end of file diff --git a/composer.json b/composer.json index 1ec9c867..d18b47b6 100644 --- a/composer.json +++ b/composer.json @@ -6,5 +6,8 @@ "psr-4": { "App\\": "app/" } + }, + "require": { + "ext-readline": "*" } } diff --git a/index.php b/index.php new file mode 100644 index 00000000..fd0864de --- /dev/null +++ b/index.php @@ -0,0 +1,12 @@ +numberText((int)readline("Enter number: ")) . PHP_EOL; \ No newline at end of file diff --git a/tests/FooBarTest.php b/tests/FooBarTest.php index 43192388..04724111 100644 --- a/tests/FooBarTest.php +++ b/tests/FooBarTest.php @@ -5,32 +5,30 @@ class FooBarTest extends TestCase { - protected FooBar $fooBar; - public function test_is_result_foo() { $result = 'Foo'; - $this->assertEquals($result, $this->fooBar->numberText(3)); - $this->assertEquals($result, $this->fooBar->numberText(6)); - $this->assertEquals($result, $this->fooBar->numberText(12)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(3)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(6)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(12)); } public function test_is_result_bar() { $result = 'Bar'; - $this->assertEquals($result, $this->fooBar->numberText(5)); - $this->assertEquals($result, $this->fooBar->numberText(10)); - $this->assertEquals($result, $this->fooBar->numberText(25)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(5)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(10)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(25)); } public function test_is_result_foo_bar() { $result = 'Foo, Bar'; - $this->assertEquals($result, $this->fooBar->numberText(15)); - $this->assertEquals($result, $this->fooBar->numberText(30)); - $this->assertEquals($result, $this->fooBar->numberText(90)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(15)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(30)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(90)); } } \ No newline at end of file From f79f2fa620199463e946b50d6f18cdf46f512194 Mon Sep 17 00:00:00 2001 From: Daniels Date: Thu, 11 Nov 2021 12:03:12 +0200 Subject: [PATCH 03/11] Created Unit tests for step 2 --- .phpunit.result.cache | 2 +- tests/FooBarQixTest.php | 70 +++++++++++++++++++++++++++++++++++++++++ tests/FooBarTest.php | 34 -------------------- 3 files changed, 71 insertions(+), 35 deletions(-) create mode 100644 tests/FooBarQixTest.php delete mode 100644 tests/FooBarTest.php diff --git a/.phpunit.result.cache b/.phpunit.result.cache index 551df692..d82f2701 100644 --- a/.phpunit.result.cache +++ b/.phpunit.result.cache @@ -1 +1 @@ -{"version":1,"defects":{"FooBarTest::test_is_result_foo":4,"FooBarTest::test_is_result_bar":4,"FooBarTest::test_is_result_foo_bar":4},"times":{"FooBarTest::test_is_result_foo":0.02,"FooBarTest::test_is_result_bar":0,"FooBarTest::test_is_result_foo_bar":0}} \ No newline at end of file +{"version":1,"defects":{"FooBarTest::test_is_result_foo":4,"FooBarTest::test_is_result_bar":4,"FooBarTest::test_is_result_foo_bar":3,"FooBarTest::test_is_result_qix":3,"FooBarQixTest::test_is_result_qix":3,"FooBarQixTest::test_is_result_foo_qix":3,"FooBarQixTest::test_is_result_bar_qix":3,"FooBarQixTest::test_is_result_foo_bar_qix":3},"times":{"FooBarTest::test_is_result_foo":0.001,"FooBarTest::test_is_result_bar":0,"FooBarTest::test_is_result_foo_bar":0,"FooBarTest::test_is_result_qix":0.024,"FooBarQixTest::test_is_result_foo":0.001,"FooBarQixTest::test_is_result_bar":0,"FooBarQixTest::test_is_result_qix":0,"FooBarQixTest::test_is_result_foo_bar":0,"FooBarQixTest::test_is_result_foo_qix":0,"FooBarQixTest::test_is_result_bar_qix":0,"FooBarQixTest::test_is_result_foo_bar_qix":0}} \ No newline at end of file diff --git a/tests/FooBarQixTest.php b/tests/FooBarQixTest.php new file mode 100644 index 00000000..f6560f27 --- /dev/null +++ b/tests/FooBarQixTest.php @@ -0,0 +1,70 @@ +assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(3)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(6)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(12)); + } + + public function test_is_result_bar() + { + $result = 'Bar'; + + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(5)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(10)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(25)); + } + + public function test_is_result_qix() + { + $result = 'Qix'; + + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(7)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(14)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(28)); + } + + public function test_is_result_foo_bar() + { + $result = 'Foo, Bar'; + + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(15)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(30)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(90)); + } + + public function test_is_result_foo_qix() + { + $result = 'Foo, Qix'; + + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(21)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(42)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(84)); + } + + public function test_is_result_bar_qix() + { + $result = 'Bar, Qix'; + + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(35)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(70)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(140)); + } + + public function test_is_result_foo_bar_qix() + { + $result = 'Foo, Bar, Qix'; + + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(105)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(210)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(420)); + } +} \ No newline at end of file diff --git a/tests/FooBarTest.php b/tests/FooBarTest.php deleted file mode 100644 index 04724111..00000000 --- a/tests/FooBarTest.php +++ /dev/null @@ -1,34 +0,0 @@ -assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(3)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(6)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(12)); - } - - public function test_is_result_bar() - { - $result = 'Bar'; - - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(5)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(10)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(25)); - } - - public function test_is_result_foo_bar() - { - $result = 'Foo, Bar'; - - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(15)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(30)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(90)); - } -} \ No newline at end of file From e7e8a7897e2ff9580ac7b7409cbf15e7ae0056fd Mon Sep 17 00:00:00 2001 From: Daniels Date: Thu, 11 Nov 2021 12:08:51 +0200 Subject: [PATCH 04/11] Wrote implementation for step 2 and modified tests --- README.md | 2 +- app/FooBar.php | 16 +++++++++++++--- index.php | 3 ++- tests/FooBarQixTest.php | 42 ++++++++++++++++++++--------------------- 4 files changed, 37 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index f7838e14..7ab200bb 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This code Kata is an extended version of https://github.com/arolla/Craft_Your_Sk 3. Read task of this step 4. Start by creating Unit tests 5. Watch as tests fail -6. Create commit +6. Create comm 7. Write an implementation 8. Happily watch as all tests pass or modify tests 9. Refactor code (if needed) diff --git a/app/FooBar.php b/app/FooBar.php index 9d4452eb..8f00a965 100644 --- a/app/FooBar.php +++ b/app/FooBar.php @@ -6,21 +6,31 @@ class FooBar { private string $multipleOfThree; private string $multipleOfFive; + private string $multipleOfSeven; - public function __construct(string $multipleOfThree, string $multipleOfFive) + public function __construct(string $multipleOfThree, string $multipleOfFive, string $multipleOfSeven) { $this->multipleOfThree = $multipleOfThree; $this->multipleOfFive = $multipleOfFive; + $this->multipleOfSeven = $multipleOfSeven; } public function numberText(int $number): string { - if ($number % 5 == 0 && $number % 3 == 0) { + if ($number % 3 == 0 && $number % 5 == 0 && $number % 7 == 0) { + return "{$this->multipleOfThree}, {$this->multipleOfFive}, {$this->multipleOfSeven}"; + } else if ($number % 3 == 0 && $number % 5 == 0) { return "{$this->multipleOfThree}, {$this->multipleOfFive}"; + } else if ($number % 3 == 0 && $number % 7 == 0) { + return "{$this->multipleOfThree}, {$this->multipleOfSeven}"; + } else if ($number % 5 == 0 && $number % 7 == 0) { + return "{$this->multipleOfFive}, {$this->multipleOfSeven}"; } else if ($number % 3 == 0) { return $this->multipleOfThree; - } else { + } else if ($number % 5 == 0) { return $this->multipleOfFive; + } else { + return $this->multipleOfSeven; } } } \ No newline at end of file diff --git a/index.php b/index.php index fd0864de..15117a55 100644 --- a/index.php +++ b/index.php @@ -6,7 +6,8 @@ $multipleOfThree = 'Foo'; $multipleOfFive = 'Bar'; +$multipleOfSeven = 'Qix'; -$fooBar = new FooBar($multipleOfThree, $multipleOfFive); +$fooBar = new FooBar($multipleOfThree, $multipleOfFive, $multipleOfSeven); echo $fooBar->numberText((int)readline("Enter number: ")) . PHP_EOL; \ No newline at end of file diff --git a/tests/FooBarQixTest.php b/tests/FooBarQixTest.php index f6560f27..c1dc9b75 100644 --- a/tests/FooBarQixTest.php +++ b/tests/FooBarQixTest.php @@ -9,62 +9,62 @@ public function test_is_result_foo() { $result = 'Foo'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(3)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(6)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(12)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(3)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(6)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(12)); } public function test_is_result_bar() { $result = 'Bar'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(5)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(10)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(25)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(5)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(10)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(25)); } public function test_is_result_qix() { $result = 'Qix'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(7)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(14)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(28)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(7)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(14)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(28)); } public function test_is_result_foo_bar() { $result = 'Foo, Bar'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(15)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(30)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(90)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(15)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(30)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(90)); } public function test_is_result_foo_qix() { $result = 'Foo, Qix'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(21)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(42)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(84)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(21)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(42)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(84)); } public function test_is_result_bar_qix() { $result = 'Bar, Qix'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(35)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(70)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(140)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(35)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(70)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(140)); } public function test_is_result_foo_bar_qix() { $result = 'Foo, Bar, Qix'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(105)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(210)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar'))->numberText(420)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(105)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(210)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(420)); } } \ No newline at end of file From f5fc43b690fec3f17939665c244740906daaf7d5 Mon Sep 17 00:00:00 2001 From: Daniels Date: Thu, 11 Nov 2021 12:59:58 +0200 Subject: [PATCH 05/11] Created Unit tests for step 3 --- .phpunit.result.cache | 2 +- tests/FooBarQixCombinedTest.php | 70 +++++++++++++++++++ ...QixTest.php => FooBarQixMultiplesTest.php} | 17 ++--- tests/FooBarQixOccurrencesTest.php | 55 +++++++++++++++ 4 files changed, 131 insertions(+), 13 deletions(-) create mode 100644 tests/FooBarQixCombinedTest.php rename tests/{FooBarQixTest.php => FooBarQixMultiplesTest.php} (70%) create mode 100644 tests/FooBarQixOccurrencesTest.php diff --git a/.phpunit.result.cache b/.phpunit.result.cache index d82f2701..f1078592 100644 --- a/.phpunit.result.cache +++ b/.phpunit.result.cache @@ -1 +1 @@ -{"version":1,"defects":{"FooBarTest::test_is_result_foo":4,"FooBarTest::test_is_result_bar":4,"FooBarTest::test_is_result_foo_bar":3,"FooBarTest::test_is_result_qix":3,"FooBarQixTest::test_is_result_qix":3,"FooBarQixTest::test_is_result_foo_qix":3,"FooBarQixTest::test_is_result_bar_qix":3,"FooBarQixTest::test_is_result_foo_bar_qix":3},"times":{"FooBarTest::test_is_result_foo":0.001,"FooBarTest::test_is_result_bar":0,"FooBarTest::test_is_result_foo_bar":0,"FooBarTest::test_is_result_qix":0.024,"FooBarQixTest::test_is_result_foo":0.001,"FooBarQixTest::test_is_result_bar":0,"FooBarQixTest::test_is_result_qix":0,"FooBarQixTest::test_is_result_foo_bar":0,"FooBarQixTest::test_is_result_foo_qix":0,"FooBarQixTest::test_is_result_bar_qix":0,"FooBarQixTest::test_is_result_foo_bar_qix":0}} \ No newline at end of file +{"version":1,"defects":{"FooBarTest::test_is_result_foo":4,"FooBarTest::test_is_result_bar":4,"FooBarTest::test_is_result_foo_bar":3,"FooBarTest::test_is_result_qix":3,"FooBarQixTest::test_is_result_qix":3,"FooBarQixTest::test_is_result_foo_qix":3,"FooBarQixTest::test_is_result_bar_qix":3,"FooBarQixTest::test_is_result_foo_bar_qix":3,"FooBarQixOccurrencesTest::test_is_result_foo":3,"FooBarQixOccurrencesTest::test_is_result_foo_qix":3,"FooBarQixOccurrencesTest::test_is_result_qix_foo":3,"FooBarQixOccurrencesTest::test_is_result_bar_foo":3,"FooBarQixOccurrencesTest::test_is_result_bar_qix":3,"FooBarQixCombinedTest::test_is_result_foo_foo":3,"FooBarQixCombinedTest::test_is_result_bar_bar":3,"FooBarQixCombinedTest::test_is_result_qix_qix":3,"FooBarQixCombinedTest::test_is_result_foo_qix":3,"FooBarQixCombinedTest::test_is_result_qix_foo":3,"FooBarQixCombinedTest::test_is_result_bar_foo":3,"FooBarQixCombinedTest::test_is_result_bar_qix":3,"FooBarQixCombinedTest::test_is_result_qix_bar":3,"FooBarQixCombinedTest::test_is_result_foo_bar":3},"times":{"FooBarTest::test_is_result_foo":0.001,"FooBarTest::test_is_result_bar":0,"FooBarTest::test_is_result_foo_bar":0,"FooBarTest::test_is_result_qix":0.024,"FooBarQixTest::test_is_result_foo":0.001,"FooBarQixTest::test_is_result_bar":0,"FooBarQixTest::test_is_result_qix":0,"FooBarQixTest::test_is_result_foo_bar":0,"FooBarQixTest::test_is_result_foo_qix":0,"FooBarQixTest::test_is_result_bar_qix":0,"FooBarQixTest::test_is_result_foo_bar_qix":0,"FooBarQixOccurrencesTest::test_is_result_foo":0.001,"FooBarQixOccurrencesTest::test_is_result_qix":0,"FooBarQixOccurrencesTest::test_is_result_foo_qix":0,"FooBarQixOccurrencesTest::test_is_result_qix_foo":0,"FooBarQixOccurrencesTest::test_is_result_bar_foo":0,"FooBarQixOccurrencesTest::test_is_result_bar_qix":0,"FooBarQixCombinedTest::test_is_result_foo_foo":0.001,"FooBarQixCombinedTest::test_is_result_bar_bar":0,"FooBarQixCombinedTest::test_is_result_qix_qix":0,"FooBarQixCombinedTest::test_is_result_foo_qix":0,"FooBarQixCombinedTest::test_is_result_qix_foo":0,"FooBarQixCombinedTest::test_is_result_bar_foo":0,"FooBarQixCombinedTest::test_is_result_bar_qix":0,"FooBarQixCombinedTest::test_is_result_foo_bar":0.001,"FooBarQixCombinedTest::test_is_result_qix_bar":0.001}} \ No newline at end of file diff --git a/tests/FooBarQixCombinedTest.php b/tests/FooBarQixCombinedTest.php new file mode 100644 index 00000000..6f0d4a84 --- /dev/null +++ b/tests/FooBarQixCombinedTest.php @@ -0,0 +1,70 @@ +assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(3)); + } + + public function test_is_result_bar_bar() + { + $result = 'Bar, Bar'; + + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(5)); + } + + public function test_is_result_qix_qix() + { + $result = 'Qix, Qix'; + + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(7)); + } + + public function test_is_result_foo_qix() + { + $result = 'Foo, Qix'; + + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(203)); + } + + public function test_is_result_qix_foo() + { + $result = 'Qix, Foo'; + + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(27)); + } + + public function test_is_result_bar_foo() + { + $result = 'Bar, Foo'; + + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(51)); + } + + public function test_is_result_bar_qix() + { + $result = 'Bar, Qix'; + + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(56)); + } + + public function test_is_result_foo_bar() + { + $result = 'Foo, Bar'; + + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(130)); + } + + public function test_is_result_qix_bar() + { + $result = 'Qix, Bar'; + + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(170)); + } +} \ No newline at end of file diff --git a/tests/FooBarQixTest.php b/tests/FooBarQixMultiplesTest.php similarity index 70% rename from tests/FooBarQixTest.php rename to tests/FooBarQixMultiplesTest.php index c1dc9b75..63819e03 100644 --- a/tests/FooBarQixTest.php +++ b/tests/FooBarQixMultiplesTest.php @@ -3,31 +3,28 @@ use App\FooBar; use PHPUnit\Framework\TestCase; -class FooBarQixTest extends TestCase +class FooBarQixMultiplesTest extends TestCase { public function test_is_result_foo() { $result = 'Foo'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(3)); $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(6)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(12)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(9)); } public function test_is_result_bar() { $result = 'Bar'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(5)); $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(10)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(25)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(20)); } public function test_is_result_qix() { $result = 'Qix'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(7)); $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(14)); $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(28)); } @@ -36,8 +33,7 @@ public function test_is_result_foo_bar() { $result = 'Foo, Bar'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(15)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(30)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(60)); $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(90)); } @@ -47,23 +43,20 @@ public function test_is_result_foo_qix() $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(21)); $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(42)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(84)); } public function test_is_result_bar_qix() { $result = 'Bar, Qix'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(35)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(70)); $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(140)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(280)); } public function test_is_result_foo_bar_qix() { $result = 'Foo, Bar, Qix'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(105)); $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(210)); $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(420)); } diff --git a/tests/FooBarQixOccurrencesTest.php b/tests/FooBarQixOccurrencesTest.php new file mode 100644 index 00000000..555fb991 --- /dev/null +++ b/tests/FooBarQixOccurrencesTest.php @@ -0,0 +1,55 @@ +assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(13)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(23)); + } + + public function test_is_result_qix() + { + $result = 'Qix'; + + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(17)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(47)); + } + + public function test_is_result_foo_qix() + { + $result = 'Foo, Qix'; + + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(37)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(137)); + } + + public function test_is_result_qix_foo() + { + $result = 'Qix, Foo'; + + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(73)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(173)); + } + + public function test_is_result_bar_foo() + { + $result = 'Bar, Foo'; + + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(53)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(253)); + } + + public function test_is_result_bar_qix() + { + $result = 'Bar, Qix'; + + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(157)); + $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(457)); + } +} \ No newline at end of file From 56b81c9eeb4e2f0c3cbb6a5c5c46b62ee5c0ebac Mon Sep 17 00:00:00 2001 From: Daniels Date: Thu, 11 Nov 2021 13:12:21 +0200 Subject: [PATCH 06/11] Wrote implementation for step 3 and modified previous implementation to match step 3 --- .phpunit.result.cache | 2 +- app/FooBar.php | 39 +++++++++++++++++++++++++-------------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/.phpunit.result.cache b/.phpunit.result.cache index f1078592..2b73eab6 100644 --- a/.phpunit.result.cache +++ b/.phpunit.result.cache @@ -1 +1 @@ -{"version":1,"defects":{"FooBarTest::test_is_result_foo":4,"FooBarTest::test_is_result_bar":4,"FooBarTest::test_is_result_foo_bar":3,"FooBarTest::test_is_result_qix":3,"FooBarQixTest::test_is_result_qix":3,"FooBarQixTest::test_is_result_foo_qix":3,"FooBarQixTest::test_is_result_bar_qix":3,"FooBarQixTest::test_is_result_foo_bar_qix":3,"FooBarQixOccurrencesTest::test_is_result_foo":3,"FooBarQixOccurrencesTest::test_is_result_foo_qix":3,"FooBarQixOccurrencesTest::test_is_result_qix_foo":3,"FooBarQixOccurrencesTest::test_is_result_bar_foo":3,"FooBarQixOccurrencesTest::test_is_result_bar_qix":3,"FooBarQixCombinedTest::test_is_result_foo_foo":3,"FooBarQixCombinedTest::test_is_result_bar_bar":3,"FooBarQixCombinedTest::test_is_result_qix_qix":3,"FooBarQixCombinedTest::test_is_result_foo_qix":3,"FooBarQixCombinedTest::test_is_result_qix_foo":3,"FooBarQixCombinedTest::test_is_result_bar_foo":3,"FooBarQixCombinedTest::test_is_result_bar_qix":3,"FooBarQixCombinedTest::test_is_result_qix_bar":3,"FooBarQixCombinedTest::test_is_result_foo_bar":3},"times":{"FooBarTest::test_is_result_foo":0.001,"FooBarTest::test_is_result_bar":0,"FooBarTest::test_is_result_foo_bar":0,"FooBarTest::test_is_result_qix":0.024,"FooBarQixTest::test_is_result_foo":0.001,"FooBarQixTest::test_is_result_bar":0,"FooBarQixTest::test_is_result_qix":0,"FooBarQixTest::test_is_result_foo_bar":0,"FooBarQixTest::test_is_result_foo_qix":0,"FooBarQixTest::test_is_result_bar_qix":0,"FooBarQixTest::test_is_result_foo_bar_qix":0,"FooBarQixOccurrencesTest::test_is_result_foo":0.001,"FooBarQixOccurrencesTest::test_is_result_qix":0,"FooBarQixOccurrencesTest::test_is_result_foo_qix":0,"FooBarQixOccurrencesTest::test_is_result_qix_foo":0,"FooBarQixOccurrencesTest::test_is_result_bar_foo":0,"FooBarQixOccurrencesTest::test_is_result_bar_qix":0,"FooBarQixCombinedTest::test_is_result_foo_foo":0.001,"FooBarQixCombinedTest::test_is_result_bar_bar":0,"FooBarQixCombinedTest::test_is_result_qix_qix":0,"FooBarQixCombinedTest::test_is_result_foo_qix":0,"FooBarQixCombinedTest::test_is_result_qix_foo":0,"FooBarQixCombinedTest::test_is_result_bar_foo":0,"FooBarQixCombinedTest::test_is_result_bar_qix":0,"FooBarQixCombinedTest::test_is_result_foo_bar":0.001,"FooBarQixCombinedTest::test_is_result_qix_bar":0.001}} \ No newline at end of file +{"version":1,"defects":{"FooBarTest::test_is_result_foo":4,"FooBarTest::test_is_result_bar":4,"FooBarTest::test_is_result_foo_bar":3,"FooBarTest::test_is_result_qix":3,"FooBarQixTest::test_is_result_qix":3,"FooBarQixTest::test_is_result_foo_qix":3,"FooBarQixTest::test_is_result_bar_qix":3,"FooBarQixTest::test_is_result_foo_bar_qix":3,"FooBarQixOccurrencesTest::test_is_result_foo":3,"FooBarQixOccurrencesTest::test_is_result_foo_qix":3,"FooBarQixOccurrencesTest::test_is_result_qix_foo":3,"FooBarQixOccurrencesTest::test_is_result_bar_foo":3,"FooBarQixOccurrencesTest::test_is_result_bar_qix":3,"FooBarQixCombinedTest::test_is_result_foo_foo":3,"FooBarQixCombinedTest::test_is_result_bar_bar":3,"FooBarQixCombinedTest::test_is_result_qix_qix":3,"FooBarQixCombinedTest::test_is_result_foo_qix":3,"FooBarQixCombinedTest::test_is_result_qix_foo":3,"FooBarQixCombinedTest::test_is_result_bar_foo":3,"FooBarQixCombinedTest::test_is_result_bar_qix":3,"FooBarQixCombinedTest::test_is_result_qix_bar":3,"FooBarQixCombinedTest::test_is_result_foo_bar":3,"FooBarQixMultiplesTest::test_is_result_foo":3,"FooBarQixMultiplesTest::test_is_result_bar":3,"FooBarQixMultiplesTest::test_is_result_qix":3,"FooBarQixMultiplesTest::test_is_result_foo_bar":3,"FooBarQixMultiplesTest::test_is_result_foo_qix":3,"FooBarQixMultiplesTest::test_is_result_bar_qix":3,"FooBarQixMultiplesTest::test_is_result_foo_bar_qix":3,"FooBarQixOccurrencesTest::test_is_result_qix":3},"times":{"FooBarTest::test_is_result_foo":0.001,"FooBarTest::test_is_result_bar":0,"FooBarTest::test_is_result_foo_bar":0,"FooBarTest::test_is_result_qix":0.024,"FooBarQixTest::test_is_result_foo":0.001,"FooBarQixTest::test_is_result_bar":0,"FooBarQixTest::test_is_result_qix":0,"FooBarQixTest::test_is_result_foo_bar":0,"FooBarQixTest::test_is_result_foo_qix":0,"FooBarQixTest::test_is_result_bar_qix":0,"FooBarQixTest::test_is_result_foo_bar_qix":0,"FooBarQixOccurrencesTest::test_is_result_foo":0.001,"FooBarQixOccurrencesTest::test_is_result_qix":0,"FooBarQixOccurrencesTest::test_is_result_foo_qix":0,"FooBarQixOccurrencesTest::test_is_result_qix_foo":0,"FooBarQixOccurrencesTest::test_is_result_bar_foo":0,"FooBarQixOccurrencesTest::test_is_result_bar_qix":0,"FooBarQixCombinedTest::test_is_result_foo_foo":0.001,"FooBarQixCombinedTest::test_is_result_bar_bar":0,"FooBarQixCombinedTest::test_is_result_qix_qix":0,"FooBarQixCombinedTest::test_is_result_foo_qix":0,"FooBarQixCombinedTest::test_is_result_qix_foo":0,"FooBarQixCombinedTest::test_is_result_bar_foo":0,"FooBarQixCombinedTest::test_is_result_bar_qix":0,"FooBarQixCombinedTest::test_is_result_foo_bar":0,"FooBarQixCombinedTest::test_is_result_qix_bar":0,"FooBarQixMultiplesTest::test_is_result_foo":0.001,"FooBarQixMultiplesTest::test_is_result_bar":0,"FooBarQixMultiplesTest::test_is_result_qix":0,"FooBarQixMultiplesTest::test_is_result_foo_bar":0,"FooBarQixMultiplesTest::test_is_result_foo_qix":0,"FooBarQixMultiplesTest::test_is_result_bar_qix":0,"FooBarQixMultiplesTest::test_is_result_foo_bar_qix":0}} \ No newline at end of file diff --git a/app/FooBar.php b/app/FooBar.php index 8f00a965..555a399d 100644 --- a/app/FooBar.php +++ b/app/FooBar.php @@ -17,20 +17,31 @@ public function __construct(string $multipleOfThree, string $multipleOfFive, str public function numberText(int $number): string { - if ($number % 3 == 0 && $number % 5 == 0 && $number % 7 == 0) { - return "{$this->multipleOfThree}, {$this->multipleOfFive}, {$this->multipleOfSeven}"; - } else if ($number % 3 == 0 && $number % 5 == 0) { - return "{$this->multipleOfThree}, {$this->multipleOfFive}"; - } else if ($number % 3 == 0 && $number % 7 == 0) { - return "{$this->multipleOfThree}, {$this->multipleOfSeven}"; - } else if ($number % 5 == 0 && $number % 7 == 0) { - return "{$this->multipleOfFive}, {$this->multipleOfSeven}"; - } else if ($number % 3 == 0) { - return $this->multipleOfThree; - } else if ($number % 5 == 0) { - return $this->multipleOfFive; - } else { - return $this->multipleOfSeven; + $result = []; + + $splitNumbers = str_split((string)$number); + + foreach ($splitNumbers as $digit) { + if ($digit == 3) { + $result[] = $this->multipleOfThree; + } + if ($digit == 5) { + $result[] = $this->multipleOfFive; + } + if ($digit == 7) { + $result[] = $this->multipleOfSeven; + } + } + if ($number % 3 == 0) { + $result[] = $this->multipleOfThree; } + if ($number % 5 == 0) { + $result[] = $this->multipleOfFive; + } + if ($number % 7 == 0) { + $result[] = $this->multipleOfSeven; + } + + return implode(", ", $result); } } \ No newline at end of file From 05b9d06bdea220f6a28924d17c390ef08da45084 Mon Sep 17 00:00:00 2001 From: Daniels Date: Thu, 11 Nov 2021 13:14:20 +0200 Subject: [PATCH 07/11] Changed class name --- app/{FooBar.php => FooBarQix.php} | 2 +- index.php | 6 +++--- tests/FooBarQixCombinedTest.php | 20 ++++++++++---------- tests/FooBarQixMultiplesTest.php | 30 +++++++++++++++--------------- tests/FooBarQixOccurrencesTest.php | 26 +++++++++++++------------- 5 files changed, 42 insertions(+), 42 deletions(-) rename app/{FooBar.php => FooBarQix.php} (98%) diff --git a/app/FooBar.php b/app/FooBarQix.php similarity index 98% rename from app/FooBar.php rename to app/FooBarQix.php index 555a399d..d2f0b09b 100644 --- a/app/FooBar.php +++ b/app/FooBarQix.php @@ -2,7 +2,7 @@ namespace App; -class FooBar +class FooBarQix { private string $multipleOfThree; private string $multipleOfFive; diff --git a/index.php b/index.php index 15117a55..4d15b0fb 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,6 @@ numberText((int)readline("Enter number: ")) . PHP_EOL; \ No newline at end of file +echo $fooBarQix->numberText((int)readline("Enter number: ")) . PHP_EOL; \ No newline at end of file diff --git a/tests/FooBarQixCombinedTest.php b/tests/FooBarQixCombinedTest.php index 6f0d4a84..bf76283e 100644 --- a/tests/FooBarQixCombinedTest.php +++ b/tests/FooBarQixCombinedTest.php @@ -1,6 +1,6 @@ assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(3)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(3)); } public function test_is_result_bar_bar() { $result = 'Bar, Bar'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(5)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(5)); } public function test_is_result_qix_qix() { $result = 'Qix, Qix'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(7)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(7)); } public function test_is_result_foo_qix() { $result = 'Foo, Qix'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(203)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(203)); } public function test_is_result_qix_foo() { $result = 'Qix, Foo'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(27)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(27)); } public function test_is_result_bar_foo() { $result = 'Bar, Foo'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(51)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(51)); } public function test_is_result_bar_qix() { $result = 'Bar, Qix'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(56)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(56)); } public function test_is_result_foo_bar() { $result = 'Foo, Bar'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(130)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(130)); } public function test_is_result_qix_bar() { $result = 'Qix, Bar'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(170)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(170)); } } \ No newline at end of file diff --git a/tests/FooBarQixMultiplesTest.php b/tests/FooBarQixMultiplesTest.php index 63819e03..89b20d8b 100644 --- a/tests/FooBarQixMultiplesTest.php +++ b/tests/FooBarQixMultiplesTest.php @@ -1,6 +1,6 @@ assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(6)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(9)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(6)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(9)); } public function test_is_result_bar() { $result = 'Bar'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(10)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(20)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(10)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(20)); } public function test_is_result_qix() { $result = 'Qix'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(14)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(28)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(14)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(28)); } public function test_is_result_foo_bar() { $result = 'Foo, Bar'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(60)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(90)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(60)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(90)); } public function test_is_result_foo_qix() { $result = 'Foo, Qix'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(21)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(42)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(21)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(42)); } public function test_is_result_bar_qix() { $result = 'Bar, Qix'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(140)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(280)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(140)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(280)); } public function test_is_result_foo_bar_qix() { $result = 'Foo, Bar, Qix'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(210)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(420)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(210)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(420)); } } \ No newline at end of file diff --git a/tests/FooBarQixOccurrencesTest.php b/tests/FooBarQixOccurrencesTest.php index 555fb991..564231bb 100644 --- a/tests/FooBarQixOccurrencesTest.php +++ b/tests/FooBarQixOccurrencesTest.php @@ -1,6 +1,6 @@ assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(13)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(23)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(13)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(23)); } public function test_is_result_qix() { $result = 'Qix'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(17)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(47)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(17)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(47)); } public function test_is_result_foo_qix() { $result = 'Foo, Qix'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(37)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(137)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(37)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(137)); } public function test_is_result_qix_foo() { $result = 'Qix, Foo'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(73)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(173)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(73)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(173)); } public function test_is_result_bar_foo() { $result = 'Bar, Foo'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(53)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(253)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(53)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(253)); } public function test_is_result_bar_qix() { $result = 'Bar, Qix'; - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(157)); - $this->assertEquals($result, (new FooBar('Foo', 'Bar', 'Qix'))->numberText(457)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(157)); + $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(457)); } } \ No newline at end of file From 9d45ff2aa807fd949077e671ec6bf44b90684ee6 Mon Sep 17 00:00:00 2001 From: Daniels Date: Thu, 11 Nov 2021 13:53:01 +0200 Subject: [PATCH 08/11] Created Unit tests for step 4 --- .phpunit.result.cache | 2 +- composer.json | 3 +- .../FooBarQixCombinedTest.php | 2 + .../FooBarQixMultiplesTest.php | 2 + .../FooBarQixOccurrencesTest.php | 2 + .../InfQixFooTests/InfQixFooCombinedTest.php | 73 +++++++++++++++++ .../InfQixFooTests/InfQixFooMultiplesTest.php | 65 +++++++++++++++ .../InfQixFooOccurrencesTest.php | 81 +++++++++++++++++++ 8 files changed, 228 insertions(+), 2 deletions(-) rename tests/{ => FooBarQixTests}/FooBarQixCombinedTest.php (98%) rename tests/{ => FooBarQixTests}/FooBarQixMultiplesTest.php (98%) rename tests/{ => FooBarQixTests}/FooBarQixOccurrencesTest.php (98%) create mode 100644 tests/InfQixFooTests/InfQixFooCombinedTest.php create mode 100644 tests/InfQixFooTests/InfQixFooMultiplesTest.php create mode 100644 tests/InfQixFooTests/InfQixFooOccurrencesTest.php diff --git a/.phpunit.result.cache b/.phpunit.result.cache index 2b73eab6..1faf1cc6 100644 --- a/.phpunit.result.cache +++ b/.phpunit.result.cache @@ -1 +1 @@ -{"version":1,"defects":{"FooBarTest::test_is_result_foo":4,"FooBarTest::test_is_result_bar":4,"FooBarTest::test_is_result_foo_bar":3,"FooBarTest::test_is_result_qix":3,"FooBarQixTest::test_is_result_qix":3,"FooBarQixTest::test_is_result_foo_qix":3,"FooBarQixTest::test_is_result_bar_qix":3,"FooBarQixTest::test_is_result_foo_bar_qix":3,"FooBarQixOccurrencesTest::test_is_result_foo":3,"FooBarQixOccurrencesTest::test_is_result_foo_qix":3,"FooBarQixOccurrencesTest::test_is_result_qix_foo":3,"FooBarQixOccurrencesTest::test_is_result_bar_foo":3,"FooBarQixOccurrencesTest::test_is_result_bar_qix":3,"FooBarQixCombinedTest::test_is_result_foo_foo":3,"FooBarQixCombinedTest::test_is_result_bar_bar":3,"FooBarQixCombinedTest::test_is_result_qix_qix":3,"FooBarQixCombinedTest::test_is_result_foo_qix":3,"FooBarQixCombinedTest::test_is_result_qix_foo":3,"FooBarQixCombinedTest::test_is_result_bar_foo":3,"FooBarQixCombinedTest::test_is_result_bar_qix":3,"FooBarQixCombinedTest::test_is_result_qix_bar":3,"FooBarQixCombinedTest::test_is_result_foo_bar":3,"FooBarQixMultiplesTest::test_is_result_foo":3,"FooBarQixMultiplesTest::test_is_result_bar":3,"FooBarQixMultiplesTest::test_is_result_qix":3,"FooBarQixMultiplesTest::test_is_result_foo_bar":3,"FooBarQixMultiplesTest::test_is_result_foo_qix":3,"FooBarQixMultiplesTest::test_is_result_bar_qix":3,"FooBarQixMultiplesTest::test_is_result_foo_bar_qix":3,"FooBarQixOccurrencesTest::test_is_result_qix":3},"times":{"FooBarTest::test_is_result_foo":0.001,"FooBarTest::test_is_result_bar":0,"FooBarTest::test_is_result_foo_bar":0,"FooBarTest::test_is_result_qix":0.024,"FooBarQixTest::test_is_result_foo":0.001,"FooBarQixTest::test_is_result_bar":0,"FooBarQixTest::test_is_result_qix":0,"FooBarQixTest::test_is_result_foo_bar":0,"FooBarQixTest::test_is_result_foo_qix":0,"FooBarQixTest::test_is_result_bar_qix":0,"FooBarQixTest::test_is_result_foo_bar_qix":0,"FooBarQixOccurrencesTest::test_is_result_foo":0.001,"FooBarQixOccurrencesTest::test_is_result_qix":0,"FooBarQixOccurrencesTest::test_is_result_foo_qix":0,"FooBarQixOccurrencesTest::test_is_result_qix_foo":0,"FooBarQixOccurrencesTest::test_is_result_bar_foo":0,"FooBarQixOccurrencesTest::test_is_result_bar_qix":0,"FooBarQixCombinedTest::test_is_result_foo_foo":0.001,"FooBarQixCombinedTest::test_is_result_bar_bar":0,"FooBarQixCombinedTest::test_is_result_qix_qix":0,"FooBarQixCombinedTest::test_is_result_foo_qix":0,"FooBarQixCombinedTest::test_is_result_qix_foo":0,"FooBarQixCombinedTest::test_is_result_bar_foo":0,"FooBarQixCombinedTest::test_is_result_bar_qix":0,"FooBarQixCombinedTest::test_is_result_foo_bar":0,"FooBarQixCombinedTest::test_is_result_qix_bar":0,"FooBarQixMultiplesTest::test_is_result_foo":0.001,"FooBarQixMultiplesTest::test_is_result_bar":0,"FooBarQixMultiplesTest::test_is_result_qix":0,"FooBarQixMultiplesTest::test_is_result_foo_bar":0,"FooBarQixMultiplesTest::test_is_result_foo_qix":0,"FooBarQixMultiplesTest::test_is_result_bar_qix":0,"FooBarQixMultiplesTest::test_is_result_foo_bar_qix":0}} \ No newline at end of file +{"version":1,"defects":{"FooBarTest::test_is_result_foo":4,"FooBarTest::test_is_result_bar":4,"FooBarTest::test_is_result_foo_bar":3,"FooBarTest::test_is_result_qix":3,"FooBarQixTest::test_is_result_qix":3,"FooBarQixTest::test_is_result_foo_qix":3,"FooBarQixTest::test_is_result_bar_qix":3,"FooBarQixTest::test_is_result_foo_bar_qix":3,"FooBarQixOccurrencesTest::test_is_result_foo":3,"FooBarQixOccurrencesTest::test_is_result_foo_qix":3,"FooBarQixOccurrencesTest::test_is_result_qix_foo":3,"FooBarQixOccurrencesTest::test_is_result_bar_foo":3,"FooBarQixOccurrencesTest::test_is_result_bar_qix":3,"FooBarQixCombinedTest::test_is_result_foo_foo":3,"FooBarQixCombinedTest::test_is_result_bar_bar":3,"FooBarQixCombinedTest::test_is_result_qix_qix":3,"FooBarQixCombinedTest::test_is_result_foo_qix":3,"FooBarQixCombinedTest::test_is_result_qix_foo":3,"FooBarQixCombinedTest::test_is_result_bar_foo":3,"FooBarQixCombinedTest::test_is_result_bar_qix":3,"FooBarQixCombinedTest::test_is_result_qix_bar":3,"FooBarQixCombinedTest::test_is_result_foo_bar":3,"FooBarQixMultiplesTest::test_is_result_foo":3,"FooBarQixMultiplesTest::test_is_result_bar":3,"FooBarQixMultiplesTest::test_is_result_qix":3,"FooBarQixMultiplesTest::test_is_result_foo_bar":3,"FooBarQixMultiplesTest::test_is_result_foo_qix":3,"FooBarQixMultiplesTest::test_is_result_bar_qix":3,"FooBarQixMultiplesTest::test_is_result_foo_bar_qix":3,"FooBarQixOccurrencesTest::test_is_result_qix":3},"times":{"FooBarTest::test_is_result_foo":0.001,"FooBarTest::test_is_result_bar":0,"FooBarTest::test_is_result_foo_bar":0,"FooBarTest::test_is_result_qix":0.024,"FooBarQixTest::test_is_result_foo":0.001,"FooBarQixTest::test_is_result_bar":0,"FooBarQixTest::test_is_result_qix":0,"FooBarQixTest::test_is_result_foo_bar":0,"FooBarQixTest::test_is_result_foo_qix":0,"FooBarQixTest::test_is_result_bar_qix":0,"FooBarQixTest::test_is_result_foo_bar_qix":0,"FooBarQixOccurrencesTest::test_is_result_foo":0.001,"FooBarQixOccurrencesTest::test_is_result_qix":0,"FooBarQixOccurrencesTest::test_is_result_foo_qix":0,"FooBarQixOccurrencesTest::test_is_result_qix_foo":0,"FooBarQixOccurrencesTest::test_is_result_bar_foo":0,"FooBarQixOccurrencesTest::test_is_result_bar_qix":0,"FooBarQixCombinedTest::test_is_result_foo_foo":0.001,"FooBarQixCombinedTest::test_is_result_bar_bar":0,"FooBarQixCombinedTest::test_is_result_qix_qix":0,"FooBarQixCombinedTest::test_is_result_foo_qix":0,"FooBarQixCombinedTest::test_is_result_qix_foo":0,"FooBarQixCombinedTest::test_is_result_bar_foo":0,"FooBarQixCombinedTest::test_is_result_bar_qix":0,"FooBarQixCombinedTest::test_is_result_foo_bar":0,"FooBarQixCombinedTest::test_is_result_qix_bar":0,"FooBarQixMultiplesTest::test_is_result_foo":0.001,"FooBarQixMultiplesTest::test_is_result_bar":0,"FooBarQixMultiplesTest::test_is_result_qix":0,"FooBarQixMultiplesTest::test_is_result_foo_bar":0,"FooBarQixMultiplesTest::test_is_result_foo_qix":0,"FooBarQixMultiplesTest::test_is_result_bar_qix":0,"FooBarQixMultiplesTest::test_is_result_foo_bar_qix":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_foo_foo":0.001,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_bar_bar":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_qix_qix":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_foo_qix":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_qix_foo":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_bar_foo":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_bar_qix":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_foo_bar":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_qix_bar":0}} \ No newline at end of file diff --git a/composer.json b/composer.json index d18b47b6..deaffc21 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,8 @@ }, "autoload": { "psr-4": { - "App\\": "app/" + "App\\": "app/", + "Tests\\": "tests/" } }, "require": { diff --git a/tests/FooBarQixCombinedTest.php b/tests/FooBarQixTests/FooBarQixCombinedTest.php similarity index 98% rename from tests/FooBarQixCombinedTest.php rename to tests/FooBarQixTests/FooBarQixCombinedTest.php index bf76283e..4370bd68 100644 --- a/tests/FooBarQixCombinedTest.php +++ b/tests/FooBarQixTests/FooBarQixCombinedTest.php @@ -1,5 +1,7 @@ assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(3)); + } + + public function test_is_result_inf_inf() + { + $result = 'Inf, Inf'; + + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(8)); + } + + public function test_is_result_qix_qix() + { + $result = 'Qix, Qix'; + + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(7)); + } + + public function test_is_result_foo_qix() + { + $result = 'Foo, Qix'; + + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(203)); + } + + public function test_is_result_qix_foo() + { + $result = 'Qix, Foo'; + + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(27)); + } + + public function test_is_result_inf_foo() + { + $result = 'Inf, Foo'; + + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(18)); + } + + public function test_is_result_foo_inf() + { + $result = 'Foo, Inf'; + + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(32)); + } + + public function test_is_result_inf_qix() + { + $result = 'Inf, Qix'; + + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(28)); + } + + public function test_is_result_qix_inf() + { + $result = 'Qix, Inf'; + + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(176)); + } +} \ No newline at end of file diff --git a/tests/InfQixFooTests/InfQixFooMultiplesTest.php b/tests/InfQixFooTests/InfQixFooMultiplesTest.php new file mode 100644 index 00000000..4a7e8f4b --- /dev/null +++ b/tests/InfQixFooTests/InfQixFooMultiplesTest.php @@ -0,0 +1,65 @@ +assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(6)); + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(9)); + } + + public function test_is_result_inf() + { + $result = 'Inf'; + + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(16)); + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(40)); + } + + public function test_is_result_qix() + { + $result = 'Qix'; + + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(14)); + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(49)); + } + + public function test_is_result_inf_foo() + { + $result = 'Inf, Foo'; + + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(24)); + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(96)); + } + + public function test_is_result_qix_foo() + { + $result = 'Qix, Foo'; + + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(21)); + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(42)); + } + + public function test_is_result_inf_qix() + { + $result = 'Inf, Qix'; + + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(56)); + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(112)); + } + + public function test_is_result_inf_qix_foo() + { + $result = 'Inf, Qix, Foo'; + + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(504)); + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(2016)); + } +} diff --git a/tests/InfQixFooTests/InfQixFooOccurrencesTest.php b/tests/InfQixFooTests/InfQixFooOccurrencesTest.php new file mode 100644 index 00000000..77f9e94d --- /dev/null +++ b/tests/InfQixFooTests/InfQixFooOccurrencesTest.php @@ -0,0 +1,81 @@ +assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(13)); + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(23)); + } + + public function test_is_result_qix() + { + $result = 'Qix'; + + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(17)); + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(47)); + } + + public function test_is_result_inf() + { + $result = 'Inf'; + + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(58)); + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(68)); + } + + public function test_is_result_foo_qix() + { + $result = 'Foo, Qix'; + + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(37)); + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(137)); + } + + public function test_is_result_qix_foo() + { + $result = 'Qix, Foo'; + + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(73)); + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(173)); + } + + public function test_is_result_inf_foo() + { + $result = 'Inf, Foo'; + + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(83)); + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(283)); + } + + public function test_is_result_foo_inf() + { + $result = 'Foo, Inf'; + + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(38)); + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(538)); + } + + public function test_is_result_inf_qix() + { + $result = 'Inf, Qix'; + + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(187)); + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(487)); + } + + public function test_is_result_qix_inf() + { + $result = 'Qix, Inf'; + + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(178)); + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(278)); + } +} \ No newline at end of file From cf609f43cb25efaf84afc45ede9de53e2872321a Mon Sep 17 00:00:00 2001 From: Daniels Date: Thu, 11 Nov 2021 14:12:28 +0200 Subject: [PATCH 09/11] Wrote implementation for step 4 and modified tests/previous implementation --- .phpunit.result.cache | 2 +- app/Combinations.php | 10 ++++ app/FooBarQix.php | 28 +++++------ app/InfQixFoo.php | 47 +++++++++++++++++++ index.php | 8 +++- .../FooBarQixTests/FooBarQixCombinedTest.php | 18 +++---- .../FooBarQixTests/FooBarQixMultiplesTest.php | 29 ++++++------ .../FooBarQixOccurrencesTest.php | 24 +++++----- .../InfQixFooTests/InfQixFooCombinedTest.php | 2 +- .../InfQixFooTests/InfQixFooMultiplesTest.php | 2 +- .../InfQixFooOccurrencesTest.php | 2 +- 11 files changed, 117 insertions(+), 55 deletions(-) create mode 100644 app/Combinations.php create mode 100644 app/InfQixFoo.php diff --git a/.phpunit.result.cache b/.phpunit.result.cache index 1faf1cc6..dbae5c0c 100644 --- a/.phpunit.result.cache +++ b/.phpunit.result.cache @@ -1 +1 @@ -{"version":1,"defects":{"FooBarTest::test_is_result_foo":4,"FooBarTest::test_is_result_bar":4,"FooBarTest::test_is_result_foo_bar":3,"FooBarTest::test_is_result_qix":3,"FooBarQixTest::test_is_result_qix":3,"FooBarQixTest::test_is_result_foo_qix":3,"FooBarQixTest::test_is_result_bar_qix":3,"FooBarQixTest::test_is_result_foo_bar_qix":3,"FooBarQixOccurrencesTest::test_is_result_foo":3,"FooBarQixOccurrencesTest::test_is_result_foo_qix":3,"FooBarQixOccurrencesTest::test_is_result_qix_foo":3,"FooBarQixOccurrencesTest::test_is_result_bar_foo":3,"FooBarQixOccurrencesTest::test_is_result_bar_qix":3,"FooBarQixCombinedTest::test_is_result_foo_foo":3,"FooBarQixCombinedTest::test_is_result_bar_bar":3,"FooBarQixCombinedTest::test_is_result_qix_qix":3,"FooBarQixCombinedTest::test_is_result_foo_qix":3,"FooBarQixCombinedTest::test_is_result_qix_foo":3,"FooBarQixCombinedTest::test_is_result_bar_foo":3,"FooBarQixCombinedTest::test_is_result_bar_qix":3,"FooBarQixCombinedTest::test_is_result_qix_bar":3,"FooBarQixCombinedTest::test_is_result_foo_bar":3,"FooBarQixMultiplesTest::test_is_result_foo":3,"FooBarQixMultiplesTest::test_is_result_bar":3,"FooBarQixMultiplesTest::test_is_result_qix":3,"FooBarQixMultiplesTest::test_is_result_foo_bar":3,"FooBarQixMultiplesTest::test_is_result_foo_qix":3,"FooBarQixMultiplesTest::test_is_result_bar_qix":3,"FooBarQixMultiplesTest::test_is_result_foo_bar_qix":3,"FooBarQixOccurrencesTest::test_is_result_qix":3},"times":{"FooBarTest::test_is_result_foo":0.001,"FooBarTest::test_is_result_bar":0,"FooBarTest::test_is_result_foo_bar":0,"FooBarTest::test_is_result_qix":0.024,"FooBarQixTest::test_is_result_foo":0.001,"FooBarQixTest::test_is_result_bar":0,"FooBarQixTest::test_is_result_qix":0,"FooBarQixTest::test_is_result_foo_bar":0,"FooBarQixTest::test_is_result_foo_qix":0,"FooBarQixTest::test_is_result_bar_qix":0,"FooBarQixTest::test_is_result_foo_bar_qix":0,"FooBarQixOccurrencesTest::test_is_result_foo":0.001,"FooBarQixOccurrencesTest::test_is_result_qix":0,"FooBarQixOccurrencesTest::test_is_result_foo_qix":0,"FooBarQixOccurrencesTest::test_is_result_qix_foo":0,"FooBarQixOccurrencesTest::test_is_result_bar_foo":0,"FooBarQixOccurrencesTest::test_is_result_bar_qix":0,"FooBarQixCombinedTest::test_is_result_foo_foo":0.001,"FooBarQixCombinedTest::test_is_result_bar_bar":0,"FooBarQixCombinedTest::test_is_result_qix_qix":0,"FooBarQixCombinedTest::test_is_result_foo_qix":0,"FooBarQixCombinedTest::test_is_result_qix_foo":0,"FooBarQixCombinedTest::test_is_result_bar_foo":0,"FooBarQixCombinedTest::test_is_result_bar_qix":0,"FooBarQixCombinedTest::test_is_result_foo_bar":0,"FooBarQixCombinedTest::test_is_result_qix_bar":0,"FooBarQixMultiplesTest::test_is_result_foo":0.001,"FooBarQixMultiplesTest::test_is_result_bar":0,"FooBarQixMultiplesTest::test_is_result_qix":0,"FooBarQixMultiplesTest::test_is_result_foo_bar":0,"FooBarQixMultiplesTest::test_is_result_foo_qix":0,"FooBarQixMultiplesTest::test_is_result_bar_qix":0,"FooBarQixMultiplesTest::test_is_result_foo_bar_qix":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_foo_foo":0.001,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_bar_bar":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_qix_qix":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_foo_qix":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_qix_foo":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_bar_foo":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_bar_qix":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_foo_bar":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_qix_bar":0}} \ No newline at end of file +{"version":1,"defects":{"FooBarTest::test_is_result_foo":4,"FooBarTest::test_is_result_bar":4,"FooBarTest::test_is_result_foo_bar":3,"FooBarTest::test_is_result_qix":3,"FooBarQixTest::test_is_result_qix":3,"FooBarQixTest::test_is_result_foo_qix":3,"FooBarQixTest::test_is_result_bar_qix":3,"FooBarQixTest::test_is_result_foo_bar_qix":3,"FooBarQixOccurrencesTest::test_is_result_foo":3,"FooBarQixOccurrencesTest::test_is_result_foo_qix":3,"FooBarQixOccurrencesTest::test_is_result_qix_foo":3,"FooBarQixOccurrencesTest::test_is_result_bar_foo":3,"FooBarQixOccurrencesTest::test_is_result_bar_qix":3,"FooBarQixCombinedTest::test_is_result_foo_foo":3,"FooBarQixCombinedTest::test_is_result_bar_bar":3,"FooBarQixCombinedTest::test_is_result_qix_qix":3,"FooBarQixCombinedTest::test_is_result_foo_qix":3,"FooBarQixCombinedTest::test_is_result_qix_foo":3,"FooBarQixCombinedTest::test_is_result_bar_foo":3,"FooBarQixCombinedTest::test_is_result_bar_qix":3,"FooBarQixCombinedTest::test_is_result_qix_bar":3,"FooBarQixCombinedTest::test_is_result_foo_bar":3,"FooBarQixMultiplesTest::test_is_result_foo":3,"FooBarQixMultiplesTest::test_is_result_bar":3,"FooBarQixMultiplesTest::test_is_result_qix":3,"FooBarQixMultiplesTest::test_is_result_foo_bar":3,"FooBarQixMultiplesTest::test_is_result_foo_qix":3,"FooBarQixMultiplesTest::test_is_result_bar_qix":3,"FooBarQixMultiplesTest::test_is_result_foo_bar_qix":3,"FooBarQixOccurrencesTest::test_is_result_qix":3,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_foo_foo":4,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_bar_bar":4,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_qix_qix":4,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_foo_qix":4,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_qix_foo":4,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_bar_foo":4,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_bar_qix":4,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_foo_bar":4,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_qix_bar":4,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_foo":3,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_bar":3,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_qix":3,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_foo_bar":3,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_foo_qix":3,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_bar_qix":3,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_foo_bar_qix":3},"times":{"FooBarTest::test_is_result_foo":0.001,"FooBarTest::test_is_result_bar":0,"FooBarTest::test_is_result_foo_bar":0,"FooBarTest::test_is_result_qix":0.024,"FooBarQixTest::test_is_result_foo":0.001,"FooBarQixTest::test_is_result_bar":0,"FooBarQixTest::test_is_result_qix":0,"FooBarQixTest::test_is_result_foo_bar":0,"FooBarQixTest::test_is_result_foo_qix":0,"FooBarQixTest::test_is_result_bar_qix":0,"FooBarQixTest::test_is_result_foo_bar_qix":0,"FooBarQixOccurrencesTest::test_is_result_foo":0.001,"FooBarQixOccurrencesTest::test_is_result_qix":0,"FooBarQixOccurrencesTest::test_is_result_foo_qix":0,"FooBarQixOccurrencesTest::test_is_result_qix_foo":0,"FooBarQixOccurrencesTest::test_is_result_bar_foo":0,"FooBarQixOccurrencesTest::test_is_result_bar_qix":0,"FooBarQixCombinedTest::test_is_result_foo_foo":0.001,"FooBarQixCombinedTest::test_is_result_bar_bar":0,"FooBarQixCombinedTest::test_is_result_qix_qix":0,"FooBarQixCombinedTest::test_is_result_foo_qix":0,"FooBarQixCombinedTest::test_is_result_qix_foo":0,"FooBarQixCombinedTest::test_is_result_bar_foo":0,"FooBarQixCombinedTest::test_is_result_bar_qix":0,"FooBarQixCombinedTest::test_is_result_foo_bar":0,"FooBarQixCombinedTest::test_is_result_qix_bar":0,"FooBarQixMultiplesTest::test_is_result_foo":0.001,"FooBarQixMultiplesTest::test_is_result_bar":0,"FooBarQixMultiplesTest::test_is_result_qix":0,"FooBarQixMultiplesTest::test_is_result_foo_bar":0,"FooBarQixMultiplesTest::test_is_result_foo_qix":0,"FooBarQixMultiplesTest::test_is_result_bar_qix":0,"FooBarQixMultiplesTest::test_is_result_foo_bar_qix":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_foo_foo":0.001,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_bar_bar":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_qix_qix":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_foo_qix":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_qix_foo":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_bar_foo":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_bar_qix":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_foo_bar":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_qix_bar":0,"Tests\\InfQixFooTests\\InfQixFooMultiplesTest::test_is_result_foo":0.001,"Tests\\InfQixFooTests\\InfQixFooMultiplesTest::test_is_result_inf":0,"Tests\\InfQixFooTests\\InfQixFooMultiplesTest::test_is_result_qix":0,"Tests\\InfQixFooTests\\InfQixFooMultiplesTest::test_is_result_inf_foo":0,"Tests\\InfQixFooTests\\InfQixFooMultiplesTest::test_is_result_qix_foo":0,"Tests\\InfQixFooTests\\InfQixFooMultiplesTest::test_is_result_inf_qix":0,"Tests\\InfQixFooTests\\InfQixFooMultiplesTest::test_is_result_inf_qix_foo":0,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_foo":0.001,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_qix":0,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_inf":0,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_foo_qix":0,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_qix_foo":0,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_inf_foo":0,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_foo_inf":0,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_inf_qix":0,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_qix_inf":0,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_foo_foo":0.001,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_inf_inf":0,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_qix_qix":0,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_foo_qix":0,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_qix_foo":0,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_inf_foo":0,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_foo_inf":0,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_inf_qix":0,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_qix_inf":0,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_foo":0.001,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_bar":0,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_qix":0,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_foo_bar":0,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_foo_qix":0,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_bar_qix":0,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_foo_bar_qix":0,"Tests\\FooBarQixTests\\FooBarQixOccurrencesTest::test_is_result_foo":0.001,"Tests\\FooBarQixTests\\FooBarQixOccurrencesTest::test_is_result_qix":0,"Tests\\FooBarQixTests\\FooBarQixOccurrencesTest::test_is_result_foo_qix":0,"Tests\\FooBarQixTests\\FooBarQixOccurrencesTest::test_is_result_qix_foo":0,"Tests\\FooBarQixTests\\FooBarQixOccurrencesTest::test_is_result_bar_foo":0,"Tests\\FooBarQixTests\\FooBarQixOccurrencesTest::test_is_result_bar_qix":0}} \ No newline at end of file diff --git a/app/Combinations.php b/app/Combinations.php new file mode 100644 index 00000000..34472db7 --- /dev/null +++ b/app/Combinations.php @@ -0,0 +1,10 @@ +multipleOfThree = $multipleOfThree; - $this->multipleOfFive = $multipleOfFive; - $this->multipleOfSeven = $multipleOfSeven; + $this->lowestNumber = $lowestNumber; + $this->midNumber = $midNumber; + $this->highestNumber = $highestNumber; } public function numberText(int $number): string @@ -23,23 +23,23 @@ public function numberText(int $number): string foreach ($splitNumbers as $digit) { if ($digit == 3) { - $result[] = $this->multipleOfThree; + $result[] = $this->lowestNumber; } if ($digit == 5) { - $result[] = $this->multipleOfFive; + $result[] = $this->midNumber; } if ($digit == 7) { - $result[] = $this->multipleOfSeven; + $result[] = $this->highestNumber; } } if ($number % 3 == 0) { - $result[] = $this->multipleOfThree; + $result[] = $this->lowestNumber; } if ($number % 5 == 0) { - $result[] = $this->multipleOfFive; + $result[] = $this->midNumber; } if ($number % 7 == 0) { - $result[] = $this->multipleOfSeven; + $result[] = $this->highestNumber; } return implode(", ", $result); diff --git a/app/InfQixFoo.php b/app/InfQixFoo.php new file mode 100644 index 00000000..783a44ff --- /dev/null +++ b/app/InfQixFoo.php @@ -0,0 +1,47 @@ +highestNumber = $highestNumber; + $this->midNumber = $midNumber; + $this->lowestNumber = $lowestNumber; + } + + public function numberText(int $number): string + { + $result = []; + + $splitNumbers = str_split((string)$number); + + foreach ($splitNumbers as $digit) { + if ($digit == 3) { + $result[] = $this->lowestNumber; + } + if ($digit == 7) { + $result[] = $this->midNumber; + } + if ($digit == 8) { + $result[] = $this->highestNumber; + } + } + if ($number % 8 == 0) { + $result[] = $this->highestNumber; + } + if ($number % 7 == 0) { + $result[] = $this->midNumber; + } + if ($number % 3 == 0) { + $result[] = $this->lowestNumber; + } + + return implode(", ", $result); + } +} \ No newline at end of file diff --git a/index.php b/index.php index 4d15b0fb..c9d2d2a1 100644 --- a/index.php +++ b/index.php @@ -1,13 +1,17 @@ numberText((int)readline("Enter number: ")) . PHP_EOL; \ No newline at end of file +echo $fooBarQix->numberText((int)readline("Enter number for service FooBarQix: ")) . PHP_EOL; +echo $infQixFoo->numberText((int)readline("Enter number for service InfQixFoo: ")) . PHP_EOL; \ No newline at end of file diff --git a/tests/FooBarQixTests/FooBarQixCombinedTest.php b/tests/FooBarQixTests/FooBarQixCombinedTest.php index 4370bd68..4a072850 100644 --- a/tests/FooBarQixTests/FooBarQixCombinedTest.php +++ b/tests/FooBarQixTests/FooBarQixCombinedTest.php @@ -11,62 +11,62 @@ public function test_is_result_foo_foo() { $result = 'Foo, Foo'; - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(3)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(3)); } public function test_is_result_bar_bar() { $result = 'Bar, Bar'; - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(5)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(5)); } public function test_is_result_qix_qix() { $result = 'Qix, Qix'; - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(7)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(7)); } public function test_is_result_foo_qix() { $result = 'Foo, Qix'; - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(203)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(203)); } public function test_is_result_qix_foo() { $result = 'Qix, Foo'; - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(27)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(27)); } public function test_is_result_bar_foo() { $result = 'Bar, Foo'; - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(51)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(51)); } public function test_is_result_bar_qix() { $result = 'Bar, Qix'; - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(56)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(56)); } public function test_is_result_foo_bar() { $result = 'Foo, Bar'; - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(130)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(130)); } public function test_is_result_qix_bar() { $result = 'Qix, Bar'; - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(170)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(170)); } } \ No newline at end of file diff --git a/tests/FooBarQixTests/FooBarQixMultiplesTest.php b/tests/FooBarQixTests/FooBarQixMultiplesTest.php index af79775c..fb15b567 100644 --- a/tests/FooBarQixTests/FooBarQixMultiplesTest.php +++ b/tests/FooBarQixTests/FooBarQixMultiplesTest.php @@ -3,6 +3,7 @@ namespace Tests\FooBarQixTests; use App\FooBarQix; +use App\InfQixFoo; use PHPUnit\Framework\TestCase; class FooBarQixMultiplesTest extends TestCase @@ -11,55 +12,55 @@ public function test_is_result_foo() { $result = 'Foo'; - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(6)); - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(9)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(6)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(9)); } public function test_is_result_bar() { $result = 'Bar'; - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(10)); - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(20)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(10)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(20)); } public function test_is_result_qix() { $result = 'Qix'; - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(14)); - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(28)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(14)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(28)); } public function test_is_result_foo_bar() { $result = 'Foo, Bar'; - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(60)); - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(90)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(60)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(90)); } public function test_is_result_foo_qix() { $result = 'Foo, Qix'; - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(21)); - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(42)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(21)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(42)); } public function test_is_result_bar_qix() { $result = 'Bar, Qix'; - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(140)); - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(280)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(140)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(280)); } public function test_is_result_foo_bar_qix() { $result = 'Foo, Bar, Qix'; - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(210)); - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(420)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(210)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(420)); } } \ No newline at end of file diff --git a/tests/FooBarQixTests/FooBarQixOccurrencesTest.php b/tests/FooBarQixTests/FooBarQixOccurrencesTest.php index 107e71a0..4b6c0d8b 100644 --- a/tests/FooBarQixTests/FooBarQixOccurrencesTest.php +++ b/tests/FooBarQixTests/FooBarQixOccurrencesTest.php @@ -11,47 +11,47 @@ public function test_is_result_foo() { $result = 'Foo'; - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(13)); - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(23)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(13)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(23)); } public function test_is_result_qix() { $result = 'Qix'; - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(17)); - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(47)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(17)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(47)); } public function test_is_result_foo_qix() { $result = 'Foo, Qix'; - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(37)); - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(137)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(37)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(137)); } public function test_is_result_qix_foo() { $result = 'Qix, Foo'; - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(73)); - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(173)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(73)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(173)); } public function test_is_result_bar_foo() { $result = 'Bar, Foo'; - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(53)); - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(253)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(53)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(253)); } public function test_is_result_bar_qix() { $result = 'Bar, Qix'; - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(157)); - $this->assertEquals($result, (new FooBarQix('Foo', 'Bar', 'Qix'))->numberText(457)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(157)); + $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(457)); } } \ No newline at end of file diff --git a/tests/InfQixFooTests/InfQixFooCombinedTest.php b/tests/InfQixFooTests/InfQixFooCombinedTest.php index 83b3b26e..1abd2701 100644 --- a/tests/InfQixFooTests/InfQixFooCombinedTest.php +++ b/tests/InfQixFooTests/InfQixFooCombinedTest.php @@ -3,7 +3,7 @@ namespace Tests\InfQixFooTests; -use App\FooBarQix; +use App\InfQixFoo; use PHPUnit\Framework\TestCase; class InfQixFooCombinedTest extends TestCase diff --git a/tests/InfQixFooTests/InfQixFooMultiplesTest.php b/tests/InfQixFooTests/InfQixFooMultiplesTest.php index 4a7e8f4b..5cde30bd 100644 --- a/tests/InfQixFooTests/InfQixFooMultiplesTest.php +++ b/tests/InfQixFooTests/InfQixFooMultiplesTest.php @@ -2,7 +2,7 @@ namespace Tests\InfQixFooTests; -use App\FooBarQix; +use App\InfQixFoo; use PHPUnit\Framework\TestCase; class InfQixFooMultiplesTest extends TestCase diff --git a/tests/InfQixFooTests/InfQixFooOccurrencesTest.php b/tests/InfQixFooTests/InfQixFooOccurrencesTest.php index 77f9e94d..cab0f1d4 100644 --- a/tests/InfQixFooTests/InfQixFooOccurrencesTest.php +++ b/tests/InfQixFooTests/InfQixFooOccurrencesTest.php @@ -2,7 +2,7 @@ namespace Tests\InfQixFooTests; -use App\FooBarQix; +use App\InfQixFoo; use PHPUnit\Framework\TestCase; class InfQixFooOccurrencesTest extends TestCase From 9c743827187bdd85cef2714e806be6813848ee94 Mon Sep 17 00:00:00 2001 From: Daniels Date: Thu, 11 Nov 2021 14:25:24 +0200 Subject: [PATCH 10/11] Fixed separator for InfQixFoo service and fixed appending of occurences(realised that appending was done incorrectly after seeing step 5) --- app/FooBarQix.php | 17 +++++++++-------- app/InfQixFoo.php | 17 +++++++++-------- tests/FooBarQixTests/FooBarQixCombinedTest.php | 18 +++++++++--------- .../FooBarQixOccurrencesTest.php | 8 ++++---- tests/InfQixFooTests/InfQixFooCombinedTest.php | 18 +++++++++--------- .../InfQixFooTests/InfQixFooMultiplesTest.php | 8 ++++---- .../InfQixFooOccurrencesTest.php | 12 ++++++------ 7 files changed, 50 insertions(+), 48 deletions(-) diff --git a/app/FooBarQix.php b/app/FooBarQix.php index df2f3c0f..195f4295 100644 --- a/app/FooBarQix.php +++ b/app/FooBarQix.php @@ -17,31 +17,32 @@ public function __construct(string $highestNumber, string $midNumber, string $lo public function numberText(int $number): string { - $result = []; + $occurrences = []; + $multiples = []; $splitNumbers = str_split((string)$number); foreach ($splitNumbers as $digit) { if ($digit == 3) { - $result[] = $this->lowestNumber; + $occurrences[] = $this->lowestNumber; } if ($digit == 5) { - $result[] = $this->midNumber; + $occurrences[] = $this->midNumber; } if ($digit == 7) { - $result[] = $this->highestNumber; + $occurrences[] = $this->highestNumber; } } if ($number % 3 == 0) { - $result[] = $this->lowestNumber; + $multiples[] = $this->lowestNumber; } if ($number % 5 == 0) { - $result[] = $this->midNumber; + $multiples[] = $this->midNumber; } if ($number % 7 == 0) { - $result[] = $this->highestNumber; + $multiples[] = $this->highestNumber; } - return implode(", ", $result); + return implode("", $occurrences) . implode(", ", $multiples); } } \ No newline at end of file diff --git a/app/InfQixFoo.php b/app/InfQixFoo.php index 783a44ff..e0ba51a1 100644 --- a/app/InfQixFoo.php +++ b/app/InfQixFoo.php @@ -17,31 +17,32 @@ public function __construct(string $highestNumber, string $midNumber, string $lo public function numberText(int $number): string { - $result = []; + $occurrences = []; + $multiples = []; $splitNumbers = str_split((string)$number); foreach ($splitNumbers as $digit) { if ($digit == 3) { - $result[] = $this->lowestNumber; + $occurrences[] = $this->lowestNumber; } if ($digit == 7) { - $result[] = $this->midNumber; + $occurrences[] = $this->midNumber; } if ($digit == 8) { - $result[] = $this->highestNumber; + $occurrences[] = $this->highestNumber; } } if ($number % 8 == 0) { - $result[] = $this->highestNumber; + $multiples[] = $this->highestNumber; } if ($number % 7 == 0) { - $result[] = $this->midNumber; + $multiples[] = $this->midNumber; } if ($number % 3 == 0) { - $result[] = $this->lowestNumber; + $multiples[] = $this->lowestNumber; } - return implode(", ", $result); + return implode("", $occurrences) . implode("; ", $multiples); } } \ No newline at end of file diff --git a/tests/FooBarQixTests/FooBarQixCombinedTest.php b/tests/FooBarQixTests/FooBarQixCombinedTest.php index 4a072850..f2d85f29 100644 --- a/tests/FooBarQixTests/FooBarQixCombinedTest.php +++ b/tests/FooBarQixTests/FooBarQixCombinedTest.php @@ -9,63 +9,63 @@ class FooBarQixCombinedTest extends TestCase { public function test_is_result_foo_foo() { - $result = 'Foo, Foo'; + $result = 'FooFoo'; $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(3)); } public function test_is_result_bar_bar() { - $result = 'Bar, Bar'; + $result = 'BarBar'; $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(5)); } public function test_is_result_qix_qix() { - $result = 'Qix, Qix'; + $result = 'QixQix'; $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(7)); } public function test_is_result_foo_qix() { - $result = 'Foo, Qix'; + $result = 'FooQix'; $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(203)); } public function test_is_result_qix_foo() { - $result = 'Qix, Foo'; + $result = 'QixFoo'; $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(27)); } public function test_is_result_bar_foo() { - $result = 'Bar, Foo'; + $result = 'BarFoo'; $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(51)); } public function test_is_result_bar_qix() { - $result = 'Bar, Qix'; + $result = 'BarQix'; $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(56)); } public function test_is_result_foo_bar() { - $result = 'Foo, Bar'; + $result = 'FooBar'; $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(130)); } public function test_is_result_qix_bar() { - $result = 'Qix, Bar'; + $result = 'QixBar'; $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(170)); } diff --git a/tests/FooBarQixTests/FooBarQixOccurrencesTest.php b/tests/FooBarQixTests/FooBarQixOccurrencesTest.php index 4b6c0d8b..50a05d9c 100644 --- a/tests/FooBarQixTests/FooBarQixOccurrencesTest.php +++ b/tests/FooBarQixTests/FooBarQixOccurrencesTest.php @@ -25,7 +25,7 @@ public function test_is_result_qix() public function test_is_result_foo_qix() { - $result = 'Foo, Qix'; + $result = 'FooQix'; $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(37)); $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(137)); @@ -33,7 +33,7 @@ public function test_is_result_foo_qix() public function test_is_result_qix_foo() { - $result = 'Qix, Foo'; + $result = 'QixFoo'; $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(73)); $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(173)); @@ -41,7 +41,7 @@ public function test_is_result_qix_foo() public function test_is_result_bar_foo() { - $result = 'Bar, Foo'; + $result = 'BarFoo'; $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(53)); $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(253)); @@ -49,7 +49,7 @@ public function test_is_result_bar_foo() public function test_is_result_bar_qix() { - $result = 'Bar, Qix'; + $result = 'BarQix'; $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(157)); $this->assertEquals($result, (new FooBarQix('Qix', 'Bar', 'Foo'))->numberText(457)); diff --git a/tests/InfQixFooTests/InfQixFooCombinedTest.php b/tests/InfQixFooTests/InfQixFooCombinedTest.php index 1abd2701..1df44fec 100644 --- a/tests/InfQixFooTests/InfQixFooCombinedTest.php +++ b/tests/InfQixFooTests/InfQixFooCombinedTest.php @@ -10,63 +10,63 @@ class InfQixFooCombinedTest extends TestCase { public function test_is_result_foo_foo() { - $result = 'Foo, Foo'; + $result = 'FooFoo'; $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(3)); } public function test_is_result_inf_inf() { - $result = 'Inf, Inf'; + $result = 'InfInf'; $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(8)); } public function test_is_result_qix_qix() { - $result = 'Qix, Qix'; + $result = 'QixQix'; $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(7)); } public function test_is_result_foo_qix() { - $result = 'Foo, Qix'; + $result = 'FooQix'; $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(203)); } public function test_is_result_qix_foo() { - $result = 'Qix, Foo'; + $result = 'QixFoo'; $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(27)); } public function test_is_result_inf_foo() { - $result = 'Inf, Foo'; + $result = 'InfFoo'; $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(18)); } public function test_is_result_foo_inf() { - $result = 'Foo, Inf'; + $result = 'FooInf'; $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(32)); } public function test_is_result_inf_qix() { - $result = 'Inf, Qix'; + $result = 'InfQix'; $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(28)); } public function test_is_result_qix_inf() { - $result = 'Qix, Inf'; + $result = 'QixInf'; $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(176)); } diff --git a/tests/InfQixFooTests/InfQixFooMultiplesTest.php b/tests/InfQixFooTests/InfQixFooMultiplesTest.php index 5cde30bd..1a465800 100644 --- a/tests/InfQixFooTests/InfQixFooMultiplesTest.php +++ b/tests/InfQixFooTests/InfQixFooMultiplesTest.php @@ -33,7 +33,7 @@ public function test_is_result_qix() public function test_is_result_inf_foo() { - $result = 'Inf, Foo'; + $result = 'Inf; Foo'; $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(24)); $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(96)); @@ -41,7 +41,7 @@ public function test_is_result_inf_foo() public function test_is_result_qix_foo() { - $result = 'Qix, Foo'; + $result = 'Qix; Foo'; $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(21)); $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(42)); @@ -49,7 +49,7 @@ public function test_is_result_qix_foo() public function test_is_result_inf_qix() { - $result = 'Inf, Qix'; + $result = 'Inf; Qix'; $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(56)); $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(112)); @@ -57,7 +57,7 @@ public function test_is_result_inf_qix() public function test_is_result_inf_qix_foo() { - $result = 'Inf, Qix, Foo'; + $result = 'Inf; Qix; Foo'; $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(504)); $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(2016)); diff --git a/tests/InfQixFooTests/InfQixFooOccurrencesTest.php b/tests/InfQixFooTests/InfQixFooOccurrencesTest.php index cab0f1d4..ad45936e 100644 --- a/tests/InfQixFooTests/InfQixFooOccurrencesTest.php +++ b/tests/InfQixFooTests/InfQixFooOccurrencesTest.php @@ -33,7 +33,7 @@ public function test_is_result_inf() public function test_is_result_foo_qix() { - $result = 'Foo, Qix'; + $result = 'FooQix'; $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(37)); $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(137)); @@ -41,7 +41,7 @@ public function test_is_result_foo_qix() public function test_is_result_qix_foo() { - $result = 'Qix, Foo'; + $result = 'QixFoo'; $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(73)); $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(173)); @@ -49,7 +49,7 @@ public function test_is_result_qix_foo() public function test_is_result_inf_foo() { - $result = 'Inf, Foo'; + $result = 'InfFoo'; $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(83)); $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(283)); @@ -57,7 +57,7 @@ public function test_is_result_inf_foo() public function test_is_result_foo_inf() { - $result = 'Foo, Inf'; + $result = 'FooInf'; $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(38)); $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(538)); @@ -65,7 +65,7 @@ public function test_is_result_foo_inf() public function test_is_result_inf_qix() { - $result = 'Inf, Qix'; + $result = 'InfQix'; $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(187)); $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(487)); @@ -73,7 +73,7 @@ public function test_is_result_inf_qix() public function test_is_result_qix_inf() { - $result = 'Qix, Inf'; + $result = 'QixInf'; $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(178)); $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(278)); From 54f2a8e2a90f315316a150011ccb32afdd538152 Mon Sep 17 00:00:00 2001 From: Daniels Date: Thu, 11 Nov 2021 14:52:48 +0200 Subject: [PATCH 11/11] Wrote Unit test and implementation for step 5 --- .phpunit.result.cache | 2 +- app/InfQixFoo.php | 8 ++++++- .../InfQixFooTests/InfQixFooCombinedTest.php | 7 ------ .../InfQixFooMultipleOfEightTest.php | 23 +++++++++++++++++++ .../InfQixFooOccurrencesTest.php | 8 +++---- 5 files changed, 35 insertions(+), 13 deletions(-) create mode 100644 tests/InfQixFooTests/InfQixFooMultipleOfEightTest.php diff --git a/.phpunit.result.cache b/.phpunit.result.cache index dbae5c0c..19d23596 100644 --- a/.phpunit.result.cache +++ b/.phpunit.result.cache @@ -1 +1 @@ -{"version":1,"defects":{"FooBarTest::test_is_result_foo":4,"FooBarTest::test_is_result_bar":4,"FooBarTest::test_is_result_foo_bar":3,"FooBarTest::test_is_result_qix":3,"FooBarQixTest::test_is_result_qix":3,"FooBarQixTest::test_is_result_foo_qix":3,"FooBarQixTest::test_is_result_bar_qix":3,"FooBarQixTest::test_is_result_foo_bar_qix":3,"FooBarQixOccurrencesTest::test_is_result_foo":3,"FooBarQixOccurrencesTest::test_is_result_foo_qix":3,"FooBarQixOccurrencesTest::test_is_result_qix_foo":3,"FooBarQixOccurrencesTest::test_is_result_bar_foo":3,"FooBarQixOccurrencesTest::test_is_result_bar_qix":3,"FooBarQixCombinedTest::test_is_result_foo_foo":3,"FooBarQixCombinedTest::test_is_result_bar_bar":3,"FooBarQixCombinedTest::test_is_result_qix_qix":3,"FooBarQixCombinedTest::test_is_result_foo_qix":3,"FooBarQixCombinedTest::test_is_result_qix_foo":3,"FooBarQixCombinedTest::test_is_result_bar_foo":3,"FooBarQixCombinedTest::test_is_result_bar_qix":3,"FooBarQixCombinedTest::test_is_result_qix_bar":3,"FooBarQixCombinedTest::test_is_result_foo_bar":3,"FooBarQixMultiplesTest::test_is_result_foo":3,"FooBarQixMultiplesTest::test_is_result_bar":3,"FooBarQixMultiplesTest::test_is_result_qix":3,"FooBarQixMultiplesTest::test_is_result_foo_bar":3,"FooBarQixMultiplesTest::test_is_result_foo_qix":3,"FooBarQixMultiplesTest::test_is_result_bar_qix":3,"FooBarQixMultiplesTest::test_is_result_foo_bar_qix":3,"FooBarQixOccurrencesTest::test_is_result_qix":3,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_foo_foo":4,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_bar_bar":4,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_qix_qix":4,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_foo_qix":4,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_qix_foo":4,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_bar_foo":4,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_bar_qix":4,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_foo_bar":4,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_qix_bar":4,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_foo":3,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_bar":3,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_qix":3,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_foo_bar":3,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_foo_qix":3,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_bar_qix":3,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_foo_bar_qix":3},"times":{"FooBarTest::test_is_result_foo":0.001,"FooBarTest::test_is_result_bar":0,"FooBarTest::test_is_result_foo_bar":0,"FooBarTest::test_is_result_qix":0.024,"FooBarQixTest::test_is_result_foo":0.001,"FooBarQixTest::test_is_result_bar":0,"FooBarQixTest::test_is_result_qix":0,"FooBarQixTest::test_is_result_foo_bar":0,"FooBarQixTest::test_is_result_foo_qix":0,"FooBarQixTest::test_is_result_bar_qix":0,"FooBarQixTest::test_is_result_foo_bar_qix":0,"FooBarQixOccurrencesTest::test_is_result_foo":0.001,"FooBarQixOccurrencesTest::test_is_result_qix":0,"FooBarQixOccurrencesTest::test_is_result_foo_qix":0,"FooBarQixOccurrencesTest::test_is_result_qix_foo":0,"FooBarQixOccurrencesTest::test_is_result_bar_foo":0,"FooBarQixOccurrencesTest::test_is_result_bar_qix":0,"FooBarQixCombinedTest::test_is_result_foo_foo":0.001,"FooBarQixCombinedTest::test_is_result_bar_bar":0,"FooBarQixCombinedTest::test_is_result_qix_qix":0,"FooBarQixCombinedTest::test_is_result_foo_qix":0,"FooBarQixCombinedTest::test_is_result_qix_foo":0,"FooBarQixCombinedTest::test_is_result_bar_foo":0,"FooBarQixCombinedTest::test_is_result_bar_qix":0,"FooBarQixCombinedTest::test_is_result_foo_bar":0,"FooBarQixCombinedTest::test_is_result_qix_bar":0,"FooBarQixMultiplesTest::test_is_result_foo":0.001,"FooBarQixMultiplesTest::test_is_result_bar":0,"FooBarQixMultiplesTest::test_is_result_qix":0,"FooBarQixMultiplesTest::test_is_result_foo_bar":0,"FooBarQixMultiplesTest::test_is_result_foo_qix":0,"FooBarQixMultiplesTest::test_is_result_bar_qix":0,"FooBarQixMultiplesTest::test_is_result_foo_bar_qix":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_foo_foo":0.001,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_bar_bar":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_qix_qix":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_foo_qix":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_qix_foo":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_bar_foo":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_bar_qix":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_foo_bar":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_qix_bar":0,"Tests\\InfQixFooTests\\InfQixFooMultiplesTest::test_is_result_foo":0.001,"Tests\\InfQixFooTests\\InfQixFooMultiplesTest::test_is_result_inf":0,"Tests\\InfQixFooTests\\InfQixFooMultiplesTest::test_is_result_qix":0,"Tests\\InfQixFooTests\\InfQixFooMultiplesTest::test_is_result_inf_foo":0,"Tests\\InfQixFooTests\\InfQixFooMultiplesTest::test_is_result_qix_foo":0,"Tests\\InfQixFooTests\\InfQixFooMultiplesTest::test_is_result_inf_qix":0,"Tests\\InfQixFooTests\\InfQixFooMultiplesTest::test_is_result_inf_qix_foo":0,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_foo":0.001,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_qix":0,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_inf":0,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_foo_qix":0,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_qix_foo":0,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_inf_foo":0,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_foo_inf":0,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_inf_qix":0,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_qix_inf":0,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_foo_foo":0.001,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_inf_inf":0,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_qix_qix":0,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_foo_qix":0,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_qix_foo":0,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_inf_foo":0,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_foo_inf":0,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_inf_qix":0,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_qix_inf":0,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_foo":0.001,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_bar":0,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_qix":0,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_foo_bar":0,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_foo_qix":0,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_bar_qix":0,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_foo_bar_qix":0,"Tests\\FooBarQixTests\\FooBarQixOccurrencesTest::test_is_result_foo":0.001,"Tests\\FooBarQixTests\\FooBarQixOccurrencesTest::test_is_result_qix":0,"Tests\\FooBarQixTests\\FooBarQixOccurrencesTest::test_is_result_foo_qix":0,"Tests\\FooBarQixTests\\FooBarQixOccurrencesTest::test_is_result_qix_foo":0,"Tests\\FooBarQixTests\\FooBarQixOccurrencesTest::test_is_result_bar_foo":0,"Tests\\FooBarQixTests\\FooBarQixOccurrencesTest::test_is_result_bar_qix":0}} \ No newline at end of file +{"version":1,"defects":{"FooBarTest::test_is_result_foo":4,"FooBarTest::test_is_result_bar":4,"FooBarTest::test_is_result_foo_bar":3,"FooBarTest::test_is_result_qix":3,"FooBarQixTest::test_is_result_qix":3,"FooBarQixTest::test_is_result_foo_qix":3,"FooBarQixTest::test_is_result_bar_qix":3,"FooBarQixTest::test_is_result_foo_bar_qix":3,"FooBarQixOccurrencesTest::test_is_result_foo":3,"FooBarQixOccurrencesTest::test_is_result_foo_qix":3,"FooBarQixOccurrencesTest::test_is_result_qix_foo":3,"FooBarQixOccurrencesTest::test_is_result_bar_foo":3,"FooBarQixOccurrencesTest::test_is_result_bar_qix":3,"FooBarQixCombinedTest::test_is_result_foo_foo":3,"FooBarQixCombinedTest::test_is_result_bar_bar":3,"FooBarQixCombinedTest::test_is_result_qix_qix":3,"FooBarQixCombinedTest::test_is_result_foo_qix":3,"FooBarQixCombinedTest::test_is_result_qix_foo":3,"FooBarQixCombinedTest::test_is_result_bar_foo":3,"FooBarQixCombinedTest::test_is_result_bar_qix":3,"FooBarQixCombinedTest::test_is_result_qix_bar":3,"FooBarQixCombinedTest::test_is_result_foo_bar":3,"FooBarQixMultiplesTest::test_is_result_foo":3,"FooBarQixMultiplesTest::test_is_result_bar":3,"FooBarQixMultiplesTest::test_is_result_qix":3,"FooBarQixMultiplesTest::test_is_result_foo_bar":3,"FooBarQixMultiplesTest::test_is_result_foo_qix":3,"FooBarQixMultiplesTest::test_is_result_bar_qix":3,"FooBarQixMultiplesTest::test_is_result_foo_bar_qix":3,"FooBarQixOccurrencesTest::test_is_result_qix":3,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_foo_foo":4,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_bar_bar":4,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_qix_qix":4,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_foo_qix":4,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_qix_foo":4,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_bar_foo":4,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_bar_qix":4,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_foo_bar":4,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_qix_bar":4,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_foo":3,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_bar":3,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_qix":3,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_foo_bar":3,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_foo_qix":3,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_bar_qix":3,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_foo_bar_qix":3},"times":{"FooBarTest::test_is_result_foo":0.001,"FooBarTest::test_is_result_bar":0,"FooBarTest::test_is_result_foo_bar":0,"FooBarTest::test_is_result_qix":0.024,"FooBarQixTest::test_is_result_foo":0.001,"FooBarQixTest::test_is_result_bar":0,"FooBarQixTest::test_is_result_qix":0,"FooBarQixTest::test_is_result_foo_bar":0,"FooBarQixTest::test_is_result_foo_qix":0,"FooBarQixTest::test_is_result_bar_qix":0,"FooBarQixTest::test_is_result_foo_bar_qix":0,"FooBarQixOccurrencesTest::test_is_result_foo":0.001,"FooBarQixOccurrencesTest::test_is_result_qix":0,"FooBarQixOccurrencesTest::test_is_result_foo_qix":0,"FooBarQixOccurrencesTest::test_is_result_qix_foo":0,"FooBarQixOccurrencesTest::test_is_result_bar_foo":0,"FooBarQixOccurrencesTest::test_is_result_bar_qix":0,"FooBarQixCombinedTest::test_is_result_foo_foo":0.001,"FooBarQixCombinedTest::test_is_result_bar_bar":0,"FooBarQixCombinedTest::test_is_result_qix_qix":0,"FooBarQixCombinedTest::test_is_result_foo_qix":0,"FooBarQixCombinedTest::test_is_result_qix_foo":0,"FooBarQixCombinedTest::test_is_result_bar_foo":0,"FooBarQixCombinedTest::test_is_result_bar_qix":0,"FooBarQixCombinedTest::test_is_result_foo_bar":0,"FooBarQixCombinedTest::test_is_result_qix_bar":0,"FooBarQixMultiplesTest::test_is_result_foo":0.001,"FooBarQixMultiplesTest::test_is_result_bar":0,"FooBarQixMultiplesTest::test_is_result_qix":0,"FooBarQixMultiplesTest::test_is_result_foo_bar":0,"FooBarQixMultiplesTest::test_is_result_foo_qix":0,"FooBarQixMultiplesTest::test_is_result_bar_qix":0,"FooBarQixMultiplesTest::test_is_result_foo_bar_qix":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_foo_foo":0.001,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_bar_bar":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_qix_qix":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_foo_qix":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_qix_foo":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_bar_foo":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_bar_qix":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_foo_bar":0,"Tests\\FooBarQixTests\\FooBarQixCombinedTest::test_is_result_qix_bar":0,"Tests\\InfQixFooTests\\InfQixFooMultiplesTest::test_is_result_foo":0.001,"Tests\\InfQixFooTests\\InfQixFooMultiplesTest::test_is_result_inf":0,"Tests\\InfQixFooTests\\InfQixFooMultiplesTest::test_is_result_qix":0,"Tests\\InfQixFooTests\\InfQixFooMultiplesTest::test_is_result_inf_foo":0,"Tests\\InfQixFooTests\\InfQixFooMultiplesTest::test_is_result_qix_foo":0,"Tests\\InfQixFooTests\\InfQixFooMultiplesTest::test_is_result_inf_qix":0,"Tests\\InfQixFooTests\\InfQixFooMultiplesTest::test_is_result_inf_qix_foo":0,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_foo":0.001,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_qix":0,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_inf":0,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_foo_qix":0,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_qix_foo":0,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_inf_foo":0,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_foo_inf":0,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_inf_qix":0,"Tests\\InfQixFooTests\\InfQixFooOccurrencesTest::test_is_result_qix_inf":0,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_foo_foo":0.001,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_inf_inf":0,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_qix_qix":0,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_foo_qix":0,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_qix_foo":0,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_inf_foo":0,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_foo_inf":0,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_inf_qix":0,"Tests\\InfQixFooTests\\InfQixFooCombinedTest::test_is_result_qix_inf":0,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_foo":0.001,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_bar":0,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_qix":0,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_foo_bar":0,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_foo_qix":0,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_bar_qix":0,"Tests\\FooBarQixTests\\FooBarQixMultiplesTest::test_is_result_foo_bar_qix":0,"Tests\\FooBarQixTests\\FooBarQixOccurrencesTest::test_is_result_foo":0.001,"Tests\\FooBarQixTests\\FooBarQixOccurrencesTest::test_is_result_qix":0,"Tests\\FooBarQixTests\\FooBarQixOccurrencesTest::test_is_result_foo_qix":0,"Tests\\FooBarQixTests\\FooBarQixOccurrencesTest::test_is_result_qix_foo":0,"Tests\\FooBarQixTests\\FooBarQixOccurrencesTest::test_is_result_bar_foo":0,"Tests\\FooBarQixTests\\FooBarQixOccurrencesTest::test_is_result_bar_qix":0,"Tests\\InfQixFooTests\\InfQixFooMultipleOfEightTest::test_is_result_Inf_Inf_Inf":0.001,"Tests\\InfQixFooTests\\InfQixFooMultipleOfEightTest::test_is_result_Inf":0}} \ No newline at end of file diff --git a/app/InfQixFoo.php b/app/InfQixFoo.php index e0ba51a1..e8419df0 100644 --- a/app/InfQixFoo.php +++ b/app/InfQixFoo.php @@ -43,6 +43,12 @@ public function numberText(int $number): string $multiples[] = $this->lowestNumber; } - return implode("", $occurrences) . implode("; ", $multiples); + $multipleOccurrences = implode("", $occurrences) . implode("; ", $multiples); + + if (array_sum($splitNumbers) % 8 == 0) { + return $multipleOccurrences . $this->highestNumber; + } else { + return $multipleOccurrences; + } } } \ No newline at end of file diff --git a/tests/InfQixFooTests/InfQixFooCombinedTest.php b/tests/InfQixFooTests/InfQixFooCombinedTest.php index 1df44fec..16729f86 100644 --- a/tests/InfQixFooTests/InfQixFooCombinedTest.php +++ b/tests/InfQixFooTests/InfQixFooCombinedTest.php @@ -15,13 +15,6 @@ public function test_is_result_foo_foo() $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(3)); } - public function test_is_result_inf_inf() - { - $result = 'InfInf'; - - $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(8)); - } - public function test_is_result_qix_qix() { $result = 'QixQix'; diff --git a/tests/InfQixFooTests/InfQixFooMultipleOfEightTest.php b/tests/InfQixFooTests/InfQixFooMultipleOfEightTest.php new file mode 100644 index 00000000..16a08d8c --- /dev/null +++ b/tests/InfQixFooTests/InfQixFooMultipleOfEightTest.php @@ -0,0 +1,23 @@ +assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(8)); + } + + public function test_is_result_Inf() + { + $result = 'Inf'; + + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(44)); + } +} \ No newline at end of file diff --git a/tests/InfQixFooTests/InfQixFooOccurrencesTest.php b/tests/InfQixFooTests/InfQixFooOccurrencesTest.php index ad45936e..a65a1503 100644 --- a/tests/InfQixFooTests/InfQixFooOccurrencesTest.php +++ b/tests/InfQixFooTests/InfQixFooOccurrencesTest.php @@ -19,7 +19,7 @@ public function test_is_result_qix() { $result = 'Qix'; - $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(17)); + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(67)); $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(47)); } @@ -60,14 +60,14 @@ public function test_is_result_foo_inf() $result = 'FooInf'; $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(38)); - $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(538)); + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(638)); } public function test_is_result_inf_qix() { $result = 'InfQix'; - $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(187)); + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(587)); $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(487)); } @@ -75,7 +75,7 @@ public function test_is_result_qix_inf() { $result = 'QixInf'; - $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(178)); + $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(478)); $this->assertEquals($result, (new InfQixFoo('Inf', 'Qix', 'Foo'))->numberText(278)); } } \ No newline at end of file