diff --git a/.gitignore b/.gitignore index 21f031a..cb4887b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ vendor .DS_Store -Thumbs.db \ No newline at end of file +Thumbs.db + +/bin +/coverage \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..50ed844 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,22 @@ +language: php + +notifications: + email: + on_success: never + on_failure: change + +php: + - '5.6' + - '7.0' + - '7.1' + +before_script: + - composer self-update + - composer install --no-interaction --dev + +script: + - mkdir -p build/logs + - phpunit --coverage-clover build/logs/clover.xml + +after_script: + - php vendor/bin/coveralls -v \ No newline at end of file diff --git a/README.md b/README.md index e69de29..0e6de6e 100644 --- a/README.md +++ b/README.md @@ -0,0 +1 @@ +[![Build Status](https://travis-ci.org/tonik/gin.svg?branch=master)](https://travis-ci.org/tonik/gin) [![Coverage Status](https://coveralls.io/repos/github/tonik/gin/badge.svg?branch=1.2.0)](https://coveralls.io/github/tonik/gin?branch=1.2.0) \ No newline at end of file diff --git a/composer.json b/composer.json index 458c297..7edb9f5 100644 --- a/composer.json +++ b/composer.json @@ -7,14 +7,21 @@ "require": { "php": ">=5.6" }, + "require-dev": { + "tonik/cli": "^1.0.0", + + "brain/monkey": "~1.3.0", + "mockery/mockery": "~1.0.0", + "phpunit/phpunit": "~5.3.0", + "satooshi/php-coveralls": "~1.0.0", + "php-mock/php-mock-phpunit": "^1.1" + }, "suggest": { - "symfony/console": "[Gin CLI] Required for the proper operation of Console component", - "symfony/finder": "[Gin CLI] Needed for `gin tonik:shake` command" + "tonik/cli": "Required for the proper operation of Gin CLI" }, "autoload": { "psr-4": { "Tonik\\Gin\\": "src/Gin/" } - }, - "minimum-stability": "dev" -} \ No newline at end of file + } +} diff --git a/composer.lock b/composer.lock index ccb8e2c..f4f43f7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,37 +4,1825 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "8b8e4067a1427ac350dbd4d586b2d46e", - "content-hash": "54f7332fbf95e5a5d46d5a78cfd141dc", + "hash": "27bfbe9aa70fe620744510e87ce43071", + "content-hash": "7f12a2a2147edbe3a1d7af5ce55a4768", "packages": [], "packages-dev": [ + { + "name": "antecedent/patchwork", + "version": "1.3.5", + "source": { + "type": "git", + "url": "https://github.com/antecedent/patchwork.git", + "reference": "908a233f8a374f02b02ff5e3d6ba687ca506d57d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/antecedent/patchwork/zipball/908a233f8a374f02b02ff5e3d6ba687ca506d57d", + "reference": "908a233f8a374f02b02ff5e3d6ba687ca506d57d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignas Rudaitis", + "email": "ignas.rudaitis@gmail.com" + } + ], + "description": "A pure PHP library that lets you redefine user-defined functions at runtime.", + "homepage": "http://antecedent.github.io/patchwork/", + "keywords": [ + "aop", + "aspect", + "interception", + "monkeypatching", + "redefinition", + "runkit", + "testing" + ], + "time": "2015-10-09 18:20:06" + }, + { + "name": "brain/monkey", + "version": "1.3.2", + "source": { + "type": "git", + "url": "https://github.com/Brain-WP/BrainMonkey.git", + "reference": "a9142f017be946aa8da045220c26421252bf98d4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/a9142f017be946aa8da045220c26421252bf98d4", + "reference": "a9142f017be946aa8da045220c26421252bf98d4", + "shasum": "" + }, + "require": { + "antecedent/patchwork": "1.3.*", + "mockery/mockery": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "mockery/mockery": "0.9.3", + "phpunit/phpunit": "~4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Brain\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Giuseppe Mazzapica", + "email": "giuseppe.mazzapica@gmail.com", + "homepage": "http://gm.zoomlab.it", + "role": "Developer" + } + ], + "description": "Mocking utility for PHP functions and WordPress plugin API", + "keywords": [ + "Monkey Patching", + "interception", + "mock", + "mock functions", + "mockery", + "patchwork", + "redefinition", + "runkit", + "test", + "testing" + ], + "time": "2016-03-28 21:01:44" + }, + { + "name": "doctrine/instantiator", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "68099b02b60bbf3b088ff5cb67bf506770ef9cac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/68099b02b60bbf3b088ff5cb67bf506770ef9cac", + "reference": "68099b02b60bbf3b088ff5cb67bf506770ef9cac", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2017-01-23 09:23:06" + }, + { + "name": "guzzle/guzzle", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle3.git", + "reference": "f7778ed85e3db90009d79725afd6c3a82dab32fe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/f7778ed85e3db90009d79725afd6c3a82dab32fe", + "reference": "f7778ed85e3db90009d79725afd6c3a82dab32fe", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.3.3", + "symfony/event-dispatcher": "~2.1" + }, + "replace": { + "guzzle/batch": "self.version", + "guzzle/cache": "self.version", + "guzzle/common": "self.version", + "guzzle/http": "self.version", + "guzzle/inflection": "self.version", + "guzzle/iterator": "self.version", + "guzzle/log": "self.version", + "guzzle/parser": "self.version", + "guzzle/plugin": "self.version", + "guzzle/plugin-async": "self.version", + "guzzle/plugin-backoff": "self.version", + "guzzle/plugin-cache": "self.version", + "guzzle/plugin-cookie": "self.version", + "guzzle/plugin-curlauth": "self.version", + "guzzle/plugin-error-response": "self.version", + "guzzle/plugin-history": "self.version", + "guzzle/plugin-log": "self.version", + "guzzle/plugin-md5": "self.version", + "guzzle/plugin-mock": "self.version", + "guzzle/plugin-oauth": "self.version", + "guzzle/service": "self.version", + "guzzle/stream": "self.version" + }, + "require-dev": { + "doctrine/cache": "~1.3", + "monolog/monolog": "~1.0", + "phpunit/phpunit": "3.7.*", + "psr/log": "~1.0", + "symfony/class-loader": "~2.1", + "zendframework/zend-cache": "2.*,<2.3", + "zendframework/zend-log": "2.*,<2.3" + }, + "suggest": { + "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.9-dev" + } + }, + "autoload": { + "psr-0": { + "Guzzle": "src/", + "Guzzle\\Tests": "tests/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Guzzle Community", + "homepage": "https://github.com/guzzle/guzzle/contributors" + } + ], + "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "abandoned": "guzzlehttp/guzzle", + "time": "2016-10-26 18:22:07" + }, + { + "name": "hamcrest/hamcrest-php", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/hamcrest/hamcrest-php.git", + "reference": "7cc81731d43f01090c3ad71adf1749e353632a79" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/7cc81731d43f01090c3ad71adf1749e353632a79", + "reference": "7cc81731d43f01090c3ad71adf1749e353632a79", + "shasum": "" + }, + "require": { + "php": "^5.3|^7.0" + }, + "replace": { + "cordoval/hamcrest-php": "*", + "davedevelopment/hamcrest-php": "*", + "kodova/hamcrest-php": "*" + }, + "require-dev": { + "phpunit/php-file-iterator": "1.3.3", + "phpunit/phpunit": "~4.0", + "satooshi/php-coveralls": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "hamcrest" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "This is the PHP port of Hamcrest Matchers", + "keywords": [ + "test" + ], + "time": "2017-01-23 09:25:21" + }, + { + "name": "mockery/mockery", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/padraic/mockery.git", + "reference": "1c99815b8736679147219a014e0cc9968d33cb71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/padraic/mockery/zipball/1c99815b8736679147219a014e0cc9968d33cb71", + "reference": "1c99815b8736679147219a014e0cc9968d33cb71", + "shasum": "" + }, + "require": { + "hamcrest/hamcrest-php": "~2.0", + "lib-pcre": ">=7.0", + "php": ">=5.6.0" + }, + "require-dev": { + "phpunit/phpunit": "~5.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Mockery": "library/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Pádraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "http://blog.astrumfutura.com" + }, + { + "name": "Dave Marshall", + "email": "dave.marshall@atstsolutions.co.uk", + "homepage": "http://davedevelopment.co.uk" + } + ], + "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.", + "homepage": "http://github.com/padraic/mockery", + "keywords": [ + "BDD", + "TDD", + "library", + "mock", + "mock objects", + "mockery", + "stub", + "test", + "test double", + "testing" + ], + "time": "2017-01-23 08:47:49" + }, + { + "name": "myclabs/deep-copy", + "version": "1.5.5", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "399c1f9781e222f6eb6cc238796f5200d1b7f108" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/399c1f9781e222f6eb6cc238796f5200d1b7f108", + "reference": "399c1f9781e222f6eb6cc238796f5200d1b7f108", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "doctrine/collections": "1.*", + "phpunit/phpunit": "~4.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "homepage": "https://github.com/myclabs/DeepCopy", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2016-10-31 17:19:45" + }, + { + "name": "php-mock/php-mock", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-mock/php-mock.git", + "reference": "bfa2d17d64dbf129073a7ba2051a96ce52749570" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-mock/php-mock/zipball/bfa2d17d64dbf129073a7ba2051a96ce52749570", + "reference": "bfa2d17d64dbf129073a7ba2051a96ce52749570", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpunit/php-text-template": "^1" + }, + "replace": { + "malkusch/php-mock": "*" + }, + "require-dev": { + "phpunit/phpunit": "^4|^5" + }, + "suggest": { + "php-mock/php-mock-mockery": "Allows using PHPMockery for Mockery integration", + "php-mock/php-mock-phpunit": "Allows integration into PHPUnit testcase with the trait PHPMock." + }, + "type": "library", + "autoload": { + "psr-4": { + "phpmock\\": [ + "classes/", + "tests/unit/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "WTFPL" + ], + "authors": [ + { + "name": "Markus Malkusch", + "email": "markus@malkusch.de", + "homepage": "http://markus.malkusch.de", + "role": "Developer" + } + ], + "description": "PHP-Mock can mock built-in PHP functions (e.g. time()). PHP-Mock relies on PHP's namespace fallback policy. No further extension is needed.", + "homepage": "https://github.com/php-mock/php-mock", + "keywords": [ + "BDD", + "TDD", + "function", + "mock", + "stub", + "test", + "test double" + ], + "time": "2015-11-11 22:37:09" + }, + { + "name": "php-mock/php-mock-integration", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-mock/php-mock-integration.git", + "reference": "e83fb65dd20cd3cf250d554cbd4682b96b684f4b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-mock/php-mock-integration/zipball/e83fb65dd20cd3cf250d554cbd4682b96b684f4b", + "reference": "e83fb65dd20cd3cf250d554cbd4682b96b684f4b", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "php-mock/php-mock": "^1", + "phpunit/php-text-template": "^1" + }, + "require-dev": { + "phpunit/phpunit": "^4|^5" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpmock\\integration\\": "classes/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "WTFPL" + ], + "authors": [ + { + "name": "Markus Malkusch", + "email": "markus@malkusch.de", + "homepage": "http://markus.malkusch.de", + "role": "Developer" + } + ], + "description": "Integration package for PHP-Mock", + "homepage": "https://github.com/php-mock/php-mock-integration", + "keywords": [ + "BDD", + "TDD", + "function", + "mock", + "stub", + "test", + "test double" + ], + "time": "2015-10-26 21:21:42" + }, + { + "name": "php-mock/php-mock-phpunit", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-mock/php-mock-phpunit.git", + "reference": "359e3038c016cee4c8f8db6387bcab3fcdebada0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-mock/php-mock-phpunit/zipball/359e3038c016cee4c8f8db6387bcab3fcdebada0", + "reference": "359e3038c016cee4c8f8db6387bcab3fcdebada0", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "php-mock/php-mock-integration": "^1", + "phpunit/phpunit": "^4.0.0 || ^5.0.0" + }, + "conflict": { + "phpunit/phpunit-mock-objects": "3.2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpmock\\phpunit\\": "classes/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "WTFPL" + ], + "authors": [ + { + "name": "Markus Malkusch", + "email": "markus@malkusch.de", + "homepage": "http://markus.malkusch.de", + "role": "Developer" + } + ], + "description": "Mock built-in PHP functions (e.g. time()) with PHPUnit. This package relies on PHP's namespace fallback policy. No further extension is needed.", + "homepage": "https://github.com/php-mock/php-mock-phpunit", + "keywords": [ + "BDD", + "TDD", + "function", + "mock", + "phpunit", + "stub", + "test", + "test double" + ], + "time": "2016-06-15 23:36:13" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2015-12-27 11:43:31" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.2.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2016-09-30 07:12:33" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.2.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2016-11-25 06:54:22" + }, + { + "name": "phpspec/prophecy", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "6c52c2722f8460122f96f86346600e1077ce22cb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/6c52c2722f8460122f96f86346600e1077ce22cb", + "reference": "6c52c2722f8460122f96f86346600e1077ce22cb", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1", + "sebastian/recursion-context": "^1.0|^2.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.0", + "phpunit/phpunit": "^4.8 || ^5.6.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2016-11-21 14:58:47" + }, + { + "name": "phpunit/php-code-coverage", + "version": "3.3.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "44cd8e3930e431658d1a5de7d282d5cb37837fd5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/44cd8e3930e431658d1a5de7d282d5cb37837fd5", + "reference": "44cd8e3930e431658d1a5de7d282d5cb37837fd5", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.2", + "phpunit/php-token-stream": "^1.4.2", + "sebastian/code-unit-reverse-lookup": "~1.0", + "sebastian/environment": "^1.3.2", + "sebastian/version": "~1.0|~2.0" + }, + "require-dev": { + "ext-xdebug": ">=2.1.4", + "phpunit/phpunit": "~5" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.4.0", + "ext-xmlwriter": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2016-05-27 16:24:29" + }, + { + "name": "phpunit/php-file-iterator", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2016-10-03 07:40:28" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21 13:50:34" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4|~5" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2016-05-12 18:03:57" + }, + { + "name": "phpunit/php-token-stream", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3b402f65a4cc90abf6e1104e388b896ce209631b", + "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2016-11-15 14:06:22" + }, + { + "name": "phpunit/phpunit", + "version": "5.3.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "6b8eb01e8b70dcf15be839efa5063ab91fbb30ee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6b8eb01e8b70dcf15be839efa5063ab91fbb30ee", + "reference": "6b8eb01e8b70dcf15be839efa5063ab91fbb30ee", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.3.1", + "phpunit/php-code-coverage": ">=3.3.0,<4.0.0", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": ">=3.1.0,<3.2.0", + "sebastian/comparator": "~1.2.2", + "sebastian/diff": "~1.2", + "sebastian/environment": "~1.3", + "sebastian/exporter": "~1.2", + "sebastian/global-state": "~1.0", + "sebastian/object-enumerator": "~1.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "~1.0|~2.0", + "symfony/yaml": "~2.1|~3.0" + }, + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2017-01-22 17:34:32" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "3.1.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "5d89f807d9eb33fbafd0351c4fc459de8128e78b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/5d89f807d9eb33fbafd0351c4fc459de8128e78b", + "reference": "5d89f807d9eb33fbafd0351c4fc459de8128e78b", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2" + }, + "require-dev": { + "phpunit/phpunit": "^5" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2016-05-26 06:15:11" + }, { "name": "psr/log", "version": "dev-master", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10 12:19:37" + }, + { + "name": "satooshi/php-coveralls", + "version": "1.0.x-dev", + "source": { + "type": "git", + "url": "https://github.com/satooshi/php-coveralls.git", + "reference": "da51d304fe8622bf9a6da39a8446e7afd432115c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/da51d304fe8622bf9a6da39a8446e7afd432115c", + "reference": "da51d304fe8622bf9a6da39a8446e7afd432115c", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-simplexml": "*", + "guzzle/guzzle": "^2.8|^3.0", + "php": ">=5.3.3", + "psr/log": "^1.0", + "symfony/config": "^2.1|^3.0", + "symfony/console": "^2.1|^3.0", + "symfony/stopwatch": "^2.0|^3.0", + "symfony/yaml": "^2.0|^3.0" + }, + "suggest": { + "symfony/http-kernel": "Allows Symfony integration" + }, + "bin": [ + "bin/coveralls" + ], + "type": "library", + "autoload": { + "psr-4": { + "Satooshi\\": "src/Satooshi/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kitamura Satoshi", + "email": "with.no.parachute@gmail.com", + "homepage": "https://www.facebook.com/satooshi.jp" + } + ], + "description": "PHP client library for Coveralls API", + "homepage": "https://github.com/satooshi/php-coveralls", + "keywords": [ + "ci", + "coverage", + "github", + "test" + ], + "time": "2016-01-20 17:35:46" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "11606652af09e847cdbbbc3ca17df26b1173a454" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/11606652af09e847cdbbbc3ca17df26b1173a454", + "reference": "11606652af09e847cdbbbc3ca17df26b1173a454", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "~5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2016-12-06 20:05:00" + }, + { + "name": "sebastian/comparator", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2f09d5a251c4a92d1a80518c2166b5d0d742bc63" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2f09d5a251c4a92d1a80518c2166b5d0d742bc63", + "reference": "2f09d5a251c4a92d1a80518c2166b5d0d742bc63", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0", + "sebastian/diff": "^1.2", + "sebastian/exporter": "^1.2 || ^2.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2016-12-10 08:07:52" + }, + { + "name": "sebastian/diff", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "d0814318784b7756fb932116acd19ee3b0cbe67a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/d0814318784b7756fb932116acd19ee3b0cbe67a", + "reference": "d0814318784b7756fb932116acd19ee3b0cbe67a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2016-10-03 07:45:03" + }, + { + "name": "sebastian/environment", + "version": "1.3.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8 || ^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2016-08-18 05:49:44" + }, + { + "name": "sebastian/exporter", + "version": "1.2.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "7dfcd2418aacbdb5e123fb23ac735acfdd6c588d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7dfcd2418aacbdb5e123fb23ac735acfdd6c588d", + "reference": "7dfcd2418aacbdb5e123fb23ac735acfdd6c588d", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2016-10-03 07:44:30" + }, + { + "name": "sebastian/global-state", + "version": "1.1.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "5a2b9ba59e8cf82fd1fdd7efb7d7846fd69ac36d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/5a2b9ba59e8cf82fd1fdd7efb7d7846fd69ac36d", + "reference": "5a2b9ba59e8cf82fd1fdd7efb7d7846fd69ac36d", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2|~5.0" + }, + "suggest": { + "ext-uopz": "*" + }, + "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" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2016-10-03 07:46:22" + }, + { + "name": "sebastian/object-enumerator", + "version": "1.0.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "1a7e888dce73bd3c1deedb345fce00329c75b065" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1a7e888dce73bd3c1deedb345fce00329c75b065", + "reference": "1a7e888dce73bd3c1deedb345fce00329c75b065", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2016-10-03 07:42:27" + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2016-10-03 07:41:43" + }, + { + "name": "sebastian/resource-operations", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "fadc83f7c41fb2924e542635fea47ae546816ece" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/fadc83f7c41fb2924e542635fea47ae546816ece", + "reference": "fadc83f7c41fb2924e542635fea47ae546816ece", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=5.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2016-10-03 07:43:09" + }, + { + "name": "sebastian/version", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "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": "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", + "time": "2016-10-03 07:35:21" + }, + { + "name": "symfony/config", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "ba3da262813160b4963fb36f573c886592da6acb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/ba3da262813160b4963fb36f573c886592da6acb", + "reference": "ba3da262813160b4963fb36f573c886592da6acb", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/filesystem": "~2.8|~3.0" + }, + "require-dev": { + "symfony/yaml": "~3.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.3-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -42,18 +1830,17 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "time": "2016-10-10 12:19:37" + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2017-01-09 21:03:44" }, { "name": "symfony/console", @@ -61,12 +1848,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "08efa49aa07dde0747198c6075a1061c750e9884" + "reference": "4272e242823935c74c4090aa9b60bcf0d42f2a2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/08efa49aa07dde0747198c6075a1061c750e9884", - "reference": "08efa49aa07dde0747198c6075a1061c750e9884", + "url": "https://api.github.com/repos/symfony/console/zipball/4272e242823935c74c4090aa9b60bcf0d42f2a2e", + "reference": "4272e242823935c74c4090aa9b60bcf0d42f2a2e", "shasum": "" }, "require": { @@ -118,7 +1905,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-01-11 12:05:48" + "time": "2017-01-21 17:19:16" }, { "name": "symfony/debug", @@ -126,12 +1913,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "88d66d1f16dd99bd0ba0712a941b7207d07e62cd" + "reference": "8dfba97c33692aef9b0f85d9b38a73972bfd7b77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/88d66d1f16dd99bd0ba0712a941b7207d07e62cd", - "reference": "88d66d1f16dd99bd0ba0712a941b7207d07e62cd", + "url": "https://api.github.com/repos/symfony/debug/zipball/8dfba97c33692aef9b0f85d9b38a73972bfd7b77", + "reference": "8dfba97c33692aef9b0f85d9b38a73972bfd7b77", "shasum": "" }, "require": { @@ -142,7 +1929,6 @@ "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" }, "require-dev": { - "symfony/class-loader": "~2.8|~3.0", "symfony/http-kernel": "~2.8|~3.0" }, "type": "library", @@ -175,7 +1961,116 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-01-15 16:05:29" + "time": "2017-01-23 08:28:52" + }, + { + "name": "symfony/event-dispatcher", + "version": "2.8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "74877977f90fb9c3e46378d5764217c55f32df34" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/74877977f90fb9c3e46378d5764217c55f32df34", + "reference": "74877977f90fb9c3e46378d5764217c55f32df34", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.0,>=2.0.5|~3.0.0", + "symfony/dependency-injection": "~2.6|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/stopwatch": "~2.3|~3.0.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2017-01-02 20:30:24" + }, + { + "name": "symfony/filesystem", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "b2de62936fea037d501159f52b7b6172cc962282" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b2de62936fea037d501159f52b7b6172cc962282", + "reference": "b2de62936fea037d501159f52b7b6172cc962282", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2017-01-08 21:15:04" }, { "name": "symfony/finder", @@ -284,11 +2179,210 @@ "shim" ], "time": "2016-11-14 01:06:16" + }, + { + "name": "symfony/stopwatch", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "edfe3407825f9657fd38a05171eb5b8df8563146" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/edfe3407825f9657fd38a05171eb5b8df8563146", + "reference": "edfe3407825f9657fd38a05171eb5b8df8563146", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2017-01-02 20:33:09" + }, + { + "name": "symfony/yaml", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "7928849b226f065dae93ec0e8be3b829f73ba67b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/7928849b226f065dae93ec0e8be3b829f73ba67b", + "reference": "7928849b226f065dae93ec0e8be3b829f73ba67b", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "require-dev": { + "symfony/console": "~2.8|~3.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2017-01-21 17:10:26" + }, + { + "name": "tonik/cli", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/tonik/cli.git", + "reference": "4fb4cfc14b82a8121c099209b08dd0c1681c80eb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tonik/cli/zipball/4fb4cfc14b82a8121c099209b08dd0c1681c80eb", + "reference": "4fb4cfc14b82a8121c099209b08dd0c1681c80eb", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "symfony/console": "~2.3|~3.0", + "symfony/finder": "~2.3|~3.0" + }, + "require-dev": { + "mockery/mockery": "~1.0.0", + "phpunit/phpunit": "~5.3.0", + "satooshi/php-coveralls": "~1.0.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Tonik\\CLI\\": "src/CLI/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "description": "CLI for tonik/gin WordPress Starter Theme.", + "keywords": [ + "cli", + "gin", + "tonik", + "wordpress" + ], + "time": "2017-01-23 11:21:13" + }, + { + "name": "webmozart/assert", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "4a8bf11547e139e77b651365113fc12850c43d9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/4a8bf11547e139e77b651365113fc12850c43d9a", + "reference": "4a8bf11547e139e77b651365113fc12850c43d9a", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2016-11-23 20:04:41" } ], "aliases": [], "minimum-stability": "dev", - "stability-flags": [], + "stability-flags": { + "tonik/cli": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/gin b/gin deleted file mode 100644 index 487b361..0000000 --- a/gin +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env php - + + + ./tests + + + + + ./src/ + + + \ No newline at end of file diff --git a/src/Gin/Asset/Asset.php b/src/Gin/Asset/Asset.php index 3f9954c..6262c2f 100644 --- a/src/Gin/Asset/Asset.php +++ b/src/Gin/Asset/Asset.php @@ -94,6 +94,16 @@ public function fileExists($file) return file_exists($file); } + /** + * Gets the Asset file. + * + * @return string + */ + public function getFile() + { + return $this->file; + } + /** * Sets the Asset file. * diff --git a/src/Gin/Foundation/Autoloader.php b/src/Gin/Foundation/Autoloader.php index 1702ca8..482e8df 100644 --- a/src/Gin/Foundation/Autoloader.php +++ b/src/Gin/Foundation/Autoloader.php @@ -38,6 +38,8 @@ public function register() throw new FileNotFoundException("Autoloaded file [{$this->getPath($file)}] cannot be found. Please, check your autoloaded entries in `config/theme.php` file."); } } + + return true; } /** diff --git a/src/Gin/Foundation/Config.php b/src/Gin/Foundation/Config.php index 212309d..e2b6bc8 100644 --- a/src/Gin/Foundation/Config.php +++ b/src/Gin/Foundation/Config.php @@ -34,7 +34,7 @@ public function __construct(array $items = []) */ public function has($key) { - return Arr::has($this->items, $key); + return isset($this->items[$key]); } /** @@ -71,40 +71,6 @@ public function set($key, $value = null) } } - /** - * Prepend a value onto an array configuration value. - * - * @param string $key - * @param mixed $value - * - * @return void - */ - public function prepend($key, $value) - { - $array = $this->get($key); - - array_unshift($array, $value); - - $this->set($key, $array); - } - - /** - * Push a value onto an array configuration value. - * - * @param string $key - * @param mixed $value - * - * @return void - */ - public function push($key, $value) - { - $array = $this->get($key); - - $array[] = $value; - - $this->set($key, $array); - } - /** * Get all of the configuration items for the application. * diff --git a/src/Gin/Foundation/Console/CLI.php b/src/Gin/Foundation/Console/CLI.php deleted file mode 100644 index 8e42906..0000000 --- a/src/Gin/Foundation/Console/CLI.php +++ /dev/null @@ -1,83 +0,0 @@ -app = new Application($this->banner); - - $this->dir = $dir; - - $this->bootstrap(); - } - - /** - * Boodstraps CLI. - * - * @return void - */ - protected function bootstrap() - { - $this->addCommands($this->commands); - - $this->app->run(); - } - - /** - * Registers commands within console application. - * - * @param array $commands - */ - protected function addCommands(array $commands) - { - foreach ($commands as $name) { - $command = new $name; - - $command->addOption( - 'directory', - 'dir', - InputOption::VALUE_REQUIRED, - 'Root directory path of theme.', - $this->dir - ); - - $this->app->add($command); - } - } -} \ No newline at end of file diff --git a/src/Gin/Foundation/Console/Command/ShakeCommand.php b/src/Gin/Foundation/Console/Command/ShakeCommand.php deleted file mode 100644 index c127bb7..0000000 --- a/src/Gin/Foundation/Console/Command/ShakeCommand.php +++ /dev/null @@ -1,347 +0,0 @@ - 'Theme Name [theme.name]', - 'theme.uri' => 'Theme URI [theme.uri]', - 'theme.description' => 'Theme Description [theme.description]', - 'theme.version' => 'Theme Version [theme.version]', - 'theme.author' => 'Author [theme.author]', - 'theme.author.uri' => 'Author URI [theme.author.uri]', - 'theme.textdomain' => 'Theme Textdomain [theme.textdomain]', - 'theme.namespace' => 'Theme Namespace [theme.namespace]', - ]; - - /** - * Directories to ignore on files finding. - * - * @var array - */ - protected $ignore = [ - "node_modules", - "vendor" - ]; - - /** - * Details of the theme. - * - * @var array - */ - protected $answers = []; - - /** - * Console input. - * - * @var \Symfony\Component\Console\Input\InputInterface - */ - protected $input; - - /** - * Console output. - * - * @var \Symfony\Component\Console\Output\OutputInterface - */ - protected $output; - - /** - * Configure the command options. - * - * @return void - */ - protected function configure() - { - $this->setName('tonik:shake') - ->setDescription('Starts setup wizard guide, which initializes starter theme.'); - } - - /** - * Execute the command. - * - * @param \Symfony\Component\Console\Input\InputInterface $input - * @param \Symfony\Component\Console\Output\OutputInterface $output - * - * @return void - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $this->setInput($input); - $this->setOutput($output); - - $this->askQuestions(); - - if ($this->askForConfirmation()) { - $this->rename(); - - return; - } - - $output->writeln('Theme initiation abored.'); - } - - /** - * Ask for theme details. - * - * @return void - */ - public function askQuestions() - { - $entries = $this->getQuestions(); - - if ($this->hasQuestions()) { - list($key, $value) = [key($entries), reset($entries)]; - - $this->unsetQuestion($key); - - $this->askForDetail($key, $value); - } - } - - /** - * Ask for specific theme detail. - * - * @param array $detail - * - * @return void - */ - public function askForDetail($key, $value) - { - $question = new Question("{$value}: "); - - $question->setNormalizer(function ($value) { - return trim($value); - }); - - $question->setValidator(function ($answer) { - if (! empty($answer)) { - return $answer; - } - - throw new RuntimeException('You have to answer to this question.'); - }); - - $answer = $this->getHelper('question') - ->ask($this->getInput(), $this->getOutput(), $question); - - $this->setAnswer($key, $answer); - - $this->askQuestions(); - } - - /** - * Asks user for confiramtion before renaming. - * - * @return boolean - */ - public function askForConfirmation() - { - $question = new ChoiceQuestion( - 'Ready to start initialization procedure. Changes will be irreversible, want to continue?', - ['yes', 'no'], - 1 - ); - - $question->setErrorMessage('Answer with `yes` or `no`.'); - - $answer = $this->getHelper('question') - ->ask($this->getInput(), $this->getOutput(), $question); - - if ('no' === $answer) { - return false; - } - - return true; - } - - /** - * Renames theme deatils. - * - * @return void - */ - protected function rename() - { - $finder = new Finder(); - - $finder->files() - ->name('*.php') - ->name('*.css') - ->name('*.json') - ->exclude($this->ignore) - ->in($this->getInput()->getOption('directory')); - - $progress = new ProgressBar($this->getOutput(), count($finder)); - - $progress->setFormat("[%bar%] %current%/%max% files\n"); - - foreach ($finder as $file) { - foreach ($this->answers as $key => $answer) { - if ($file->getExtension() !== 'json') { - $answer = stripslashes($answer); - } - - file_put_contents( - $file->getRealPath(), - str_replace("{{ {$key} }}", $answer, $file->getContents()) - ); - } - - $progress->advance(); - } - - $progress->finish(); - - $this->getOutput()->writeln("Theme successufully initialized. Cheers!"); - } - - /** - * Finds and replaces string for all files in directory. - * - * @param string $where - * @param string $search - * @param string $replace - * - * @return void - */ - private function findAndReplaceInDir($where, $search, $replace) - { - exec("find {$where} -type f \( -name \*.php -o -name \*.css -o -name \*.json \) -exec \ - sed -i '' 's/{$search}/{$replace}/g' {} +"); - } - - /** - * Finds and replaces string in file. - * - * @param string $where - * @param string $search - * @param string $replace - * - * @return void - */ - private function findAndReplaceInFile($where, $search, $replace) - { - exec("sed -i '' 's/{$search}/{$replace}/g' {$where}"); - } - - /** - * Gets the List of theme details entries. - * - * @return array - */ - public function getQuestions() - { - return $this->questions; - } - - /** - * Checks if details has entries. - * - * @return boolean - */ - public function hasQuestions() - { - return ! empty($this->questions); - } - - /** - * Unsets entry in details. - * - * @param string $key - * - * @return void - */ - public function unsetQuestion($key) - { - unset($this->questions[$key]); - } - - /** - * Sets entry in details answers. - * - * @param string $key - * @param string $value - * - * @return void - */ - public function setAnswer($key, $value) - { - $this->answers[$key] = addslashes($value); - - return $this; - } - - /** - * Gets entry in details answers. - * - * @param string $key - * - * @return void - */ - public function getAnswer($key) - { - return $this->answers[$key]; - } - - /** - * Gets the Console input. - * - * @return \Symfony\Component\Console\Input\InputInterface - */ - public function getInput() - { - return $this->input; - } - - /** - * Sets the Console input. - * - * @param \Symfony\Component\Console\Input\InputInterface $input the input - * - * @return self - */ - protected function setInput(InputInterface $input) - { - $this->input = $input; - - return $this; - } - - /** - * Gets the Console output. - * - * @return \Symfony\Component\Console\Output\OutputInterface - */ - public function getOutput() - { - return $this->output; - } - - /** - * Sets the Console output. - * - * @param \Symfony\Component\Console\Output\OutputInterface $output the output - * - * @return self - */ - protected function setOutput(OutputInterface $output) - { - $this->output = $output; - - return $this; - } -} diff --git a/src/Gin/Foundation/Console/Kernel.php b/src/Gin/Foundation/Console/Kernel.php new file mode 100644 index 0000000..9c51f6d --- /dev/null +++ b/src/Gin/Foundation/Console/Kernel.php @@ -0,0 +1,38 @@ +dir = $dir; + } + + public function boot(Application $app, CLI $cli) + { + $app->setName(self::BANNER); + + return $cli->boot($app, $this->dir); + } +} \ No newline at end of file diff --git a/tests/Gin/Asset/AssetTest.php b/tests/Gin/Asset/AssetTest.php new file mode 100644 index 0000000..172d1d7 --- /dev/null +++ b/tests/Gin/Asset/AssetTest.php @@ -0,0 +1,143 @@ +getConfig(); + $asset = $this->getAsset($config, 'js/sample-asset.js'); + + $this->assertEquals($asset->getFile(), 'js/sample-asset.js'); + } + + /** + * @test + */ + public function test_relative_path_getter() + { + $config = $this->getConfig(); + $asset = $this->getAsset($config, 'js/sample-asset.js'); + + $config->shouldReceive('offsetGet') + ->with('directories') + ->andReturn(['public' => 'public']); + + $this->assertEquals($asset->getRelativePath(), 'public/js/sample-asset.js'); + } + + /** + * @test + */ + public function test_public_path_getter() + { + $config = $this->getConfig(); + $asset = $this->getAsset($config, 'js/sample-asset.js'); + + $config->shouldReceive('offsetGet') + ->with('paths') + ->andReturn(['directory' => 'abs/path']); + + $config->shouldReceive('offsetGet') + ->with('directories') + ->andReturn(['public' => 'public']); + + $this->assertEquals($asset->getPublicPath(), 'abs/path/public/js/sample-asset.js'); + } + + /** + * @test + */ + public function test_public_uri_getter() + { + $config = $this->getConfig(); + $asset = $this->getAsset($config, 'js/sample-asset.js'); + + $config->shouldReceive('offsetGet') + ->with('paths') + ->andReturn(['uri' => 'uri/path']); + + $config->shouldReceive('offsetGet') + ->with('directories') + ->andReturn(['public' => 'public']); + + $this->assertEquals($asset->getPublicUri(), 'uri/path/public/js/sample-asset.js'); + } + + /** + * @test + */ + public function test_uri_getter() + { + $config = $this->getConfig(); + $asset = $this->getAsset($config, 'js/sample-asset.js'); + + $exists = $this->getFunctionMock(__NAMESPACE__, "file_exists"); + $exists->expects($this->once())->willReturn(true); + + $config->shouldReceive('offsetGet') + ->with('paths') + ->andReturn([ + 'directory' => 'abs/path', + 'uri' => 'uri/path' + ]); + + $config->shouldReceive('offsetGet') + ->with('directories') + ->andReturn(['public' => 'public']); + + $this->assertEquals($asset->getUri(), 'uri/path/public/js/sample-asset.js'); + } + + /** + * @test + */ + public function it_should_throw_on_file_if_no_asset_file() + { + $config = $this->getConfig(); + $asset = $this->getAsset($config, 'js/sample-asset.js'); + + $config->shouldReceive('offsetGet') + ->with('paths') + ->andReturn(['directory' => 'abs/path']); + + $config->shouldReceive('offsetGet') + ->with('directories') + ->andReturn(['public' => 'public']); + + $this->expectException(FileNotFoundException::class); + + $asset->getUri(); + } + + public function getConfig() + { + return Mockery::mock(Config::class, [ + 'paths' => [ + 'uri' => 'uri/path', + ], + 'directories' => [ + 'assets' => 'resources/assets' + ] + ]); + } + + public function getAsset($config, $name) + { + return (new Asset($config))->setFile($name); + } +} \ No newline at end of file diff --git a/tests/Gin/Foundation/AutoloaderTest.php b/tests/Gin/Foundation/AutoloaderTest.php new file mode 100644 index 0000000..17217ea --- /dev/null +++ b/tests/Gin/Foundation/AutoloaderTest.php @@ -0,0 +1,121 @@ +getConfig(); + $autoloader = $this->getAutoloader($config); + + $config->shouldReceive('offsetGet') + ->with('directories') + ->andReturn(['src' => 'src']); + + $this->assertEquals($autoloader->getRelativePath('file/to/load.php'), 'src/file/to/load.php'); + } + + /** + * @test + */ + public function test_path_getter() + { + $config = $this->getConfig(); + $autoloader = $this->getAutoloader($config); + + $config->shouldReceive('offsetGet') + ->with('directories') + ->andReturn(['src' => 'src']); + + $config->shouldReceive('offsetGet') + ->with('paths') + ->andReturn(['directory' => 'abs/path']); + + $this->assertEquals($autoloader->getPath('file/to/load.php'), 'abs/path/src/file/to/load.php'); + } + + /** + * @test + */ + public function it_should_throw_if_no_file() + { + $config = $this->getConfig(); + $autoloader = $this->getAutoloader($config); + + Functions::expect('locate_template') + ->once() + ->with('src/file/to/load.php', true, true) + ->andReturn(false); + + $this->expectException(FileNotFoundException::class); + + $config->shouldReceive('offsetGet') + ->with('directories') + ->andReturn(['src' => 'src']); + + $config->shouldReceive('offsetGet') + ->with('paths') + ->andReturn(['directory' => 'abs/path']); + + $config->shouldReceive('offsetGet') + ->with('autoload') + ->andReturn(['file/to/load.php']); + + $autoloader->register(); + } + + /** + * @test + */ + public function it_should_return_true_on_successfully_autoloading() + { + $config = $this->getConfig(); + $autoloader = $this->getAutoloader($config); + + Functions::expect('locate_template') + ->once() + ->with('src/file/to/load.php', true, true) + ->andReturn(true); + + $config->shouldReceive('offsetGet') + ->with('directories') + ->andReturn(['src' => 'src']); + + $config->shouldReceive('offsetGet') + ->with('paths') + ->andReturn(['directory' => 'abs/path']); + + $config->shouldReceive('offsetGet') + ->with('autoload') + ->andReturn(['file/to/load.php']); + + $this->assertEquals($autoloader->register(), true); + } + + public function getConfig() + { + return Mockery::mock(Config::class, [ + 'paths' => [ + 'directory' => 'abs/path', + ], + 'directories' => [ + 'src' => 'src' + ], + 'autoload' => [ + 'file/to/load.php', + ] + ]); + } + + public function getAutoloader($config) + { + return new Autoloader($config); + } +} \ No newline at end of file diff --git a/tests/Gin/Foundation/ConfigTest.php b/tests/Gin/Foundation/ConfigTest.php new file mode 100644 index 0000000..e4ae024 --- /dev/null +++ b/tests/Gin/Foundation/ConfigTest.php @@ -0,0 +1,77 @@ +getConfig(); + + $this->assertEquals($config->all(), [ + 'item1' => 'value1', + 'item2' => [ + 'child' => 'value2' + ] + ]); + } + + /** + * @test + */ + public function test_items_getter() + { + $config = $this->getConfig(); + + $this->assertEquals($config->get('item1'), 'value1'); + $this->assertEquals($config->get('non_exists_item', 'default_value'), 'default_value'); + $this->assertEquals($config['item2'], ['child' => 'value2']); + } + + /** + * @test + */ + public function test_items_setter() + { + $config = $this->getConfig(); + + $config['item1'] = 'new_value1'; + $config->set('item2', 'new_value2'); + $config->set([ + 'item3' => 'value3', + 'item4' => 'value4', + ]); + + $this->assertEquals($config->all(), [ + 'item1' => 'new_value1', + 'item2' => 'new_value2', + 'item3' => 'value3', + 'item4' => 'value4', + ]); + } + + /** + * @test + */ + public function test_items_unsetter() + { + $config = $this->getConfig(); + + unset($config['item1']); + + $this->assertFalse(isset($config['item1'])); + } + + public function getConfig() + { + return new Config([ + 'item1' => 'value1', + 'item2' => [ + 'child' => 'value2' + ] + ]); + } +} \ No newline at end of file diff --git a/tests/Gin/Foundation/Console/KernelTest.php b/tests/Gin/Foundation/Console/KernelTest.php new file mode 100644 index 0000000..f55dbd5 --- /dev/null +++ b/tests/Gin/Foundation/Console/KernelTest.php @@ -0,0 +1,34 @@ +getKernel(); + + $app = Mockery::mock(Application::class); + $cli = Mockery::mock(CLI::class); + + $app->shouldReceive('setName') + ->with(Kernel::BANNER) + ->andReturn($app); + + $cli->shouldReceive('boot') + ->with($app, 'dir/path') + ->andReturn(true); + + $kernel->boot($app, $cli); + } + + public function getKernel() + { + return new Kernel('dir/path'); + } +} \ No newline at end of file diff --git a/tests/Gin/Foundation/ThemeTest.php b/tests/Gin/Foundation/ThemeTest.php new file mode 100644 index 0000000..d1f2eab --- /dev/null +++ b/tests/Gin/Foundation/ThemeTest.php @@ -0,0 +1,28 @@ +assertEquals(Theme::getInstance(), $theme); + } + + /** + * @test + */ + public function test_binding_and_resolving_from_theme_container() + { + $theme = Theme::getInstance(); + + $theme->bind('key', 'value'); + + $this->assertEquals(Theme::getInstance()->get('key'), 'value'); + } +} \ No newline at end of file diff --git a/tests/Gin/Template/TemplateTest.php b/tests/Gin/Template/TemplateTest.php new file mode 100644 index 0000000..ba32a34 --- /dev/null +++ b/tests/Gin/Template/TemplateTest.php @@ -0,0 +1,172 @@ +getConfig(); + $template = $this->getTemplate($config, 'sample-template'); + + $this->assertEquals($template->getFile(), 'sample-template'); + } + + /** + * @test + */ + public function test_absolute_path_getter() + { + $config = $this->getConfig(); + $template = $this->getTemplate($config, 'sample-template'); + + $config->shouldReceive('offsetGet') + ->with('paths') + ->andReturn(['directory' => 'abs/path']); + + $config->shouldReceive('offsetGet') + ->with('directories') + ->andReturn(['templates' => 'resources/templates']); + + $this->assertEquals($template->getPath(), 'abs/path/resources/templates/sample-template.php'); + } + + /** + * @test + */ + public function test_relative_path_getter() + { + $config = $this->getConfig(); + $template = $this->getTemplate($config, 'sample-template'); + + $config->shouldReceive('offsetGet') + ->with('directories') + ->andReturn(['templates' => 'resources/templates']); + + $this->assertEquals($template->getRelativePath(), 'resources/templates/sample-template.php'); + } + + /** + * @test + */ + public function it_should_throw_exception_on_render_if_file_is_no_located() + { + $config = $this->getConfig(); + $template = $this->getTemplate($config, 'sample-template'); + + Functions::expect('locate_template') + ->once() + ->with('resources/templates/sample-template.php', false, false) + ->andReturn(false); + + $config->shouldReceive('offsetGet') + ->with('directories') + ->andReturn(['templates' => 'resources/templates']); + + $this->expectException(FileNotFoundException::class); + + $template->render(); + } + + /** + * @test + */ + public function it_should_do_get_template_part_action_on_render_with_no_named_template() + { + $config = $this->getConfig(); + $template = $this->getTemplate($config, 'sample-template'); + + Functions::expect('locate_template') + ->twice() + ->andReturn(true); + + Actions::expectFired('get_template_part_sample-template') + ->once() + ->with('sample-template', null); + + $config->shouldReceive('offsetGet') + ->with('directories') + ->andReturn(['templates' => 'resources/templates']); + + $template->render(); + } + + /** + * @test + */ + public function it_should_do_get_template_part_action_on_render_with_named_template() + { + $config = $this->getConfig(); + $template = $this->getTemplate($config, ['sample-template', 'named']); + + Functions::expect('locate_template') + ->twice() + ->andReturn(true); + + Actions::expectFired('get_template_part_sample-template') + ->once() + ->with('sample-template', 'named'); + + $config->shouldReceive('offsetGet') + ->with('directories') + ->andReturn(['templates' => 'resources/templates']); + + $template->render(); + } + + /** + * @test + */ + public function it_should_set_up_context_to_the_query_var() + { + $config = $this->getConfig(); + $template = $this->getTemplate($config, ['sample-template', 'named']); + + Functions::expect('locate_template') + ->twice() + ->andReturn(true); + + Functions::expect('set_query_var') + ->once() + ->with('key1', 'value1') + ->andReturn(null); + + Functions::expect('set_query_var') + ->once() + ->with('key2', 'value2') + ->andReturn(null); + + $config->shouldReceive('offsetGet') + ->with('directories') + ->andReturn(['templates' => 'resources/templates']); + + $template->render([ + 'key1' => 'value1', + 'key2' => 'value2' + ]); + } + + public function getConfig() + { + return Mockery::mock(Config::class, [ + 'paths' => [ + 'directory' => 'abs/path', + ], + 'directories' => [ + 'templates' => 'resources/templates' + ] + ]); + } + + public function getTemplate($config, $name) + { + return (new Template($config))->setFile($name); + } +} \ No newline at end of file diff --git a/tests/TestCase.php b/tests/TestCase.php new file mode 100644 index 0000000..90e781c --- /dev/null +++ b/tests/TestCase.php @@ -0,0 +1,19 @@ +