diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..ff72e2d0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/composer.lock +/vendor diff --git a/.travis.yml b/.travis.yml index 3829bf1c..6e37033b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,12 @@ php: - 5.5 - 5.6 - hhvm + - 7 script: - - phpunit -c tests/unit/ --coverage-clover=coverage.clover + - phpunit --coverage-clover=coverage.clover after_script: - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover coverage.clover +tools: + external_code_coverage: + runs: 6 diff --git a/README.md b/README.md index ea1fb6e8..98a83087 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Finally, please note that this package is intended for use as a **dependency inj ### Installation -This library requires PHP 5.3 or later, and has no userland dependencies. +This library requires PHP 5.3 or later; we recommend using the latest available version of PHP as a matter of principle. It has no userland dependencies. It is installable and autoloadable via Composer as [aura/di](https://packagist.org/packages/aura/di). @@ -38,9 +38,10 @@ Alternatively, [download a release](https://github.com/auraphp/Aura.Di/releases) [![Code Coverage](https://scrutinizer-ci.com/g/auraphp/Aura.Di/badges/coverage.png?b=develop-2)](https://scrutinizer-ci.com/g/auraphp/Aura.Di/) [![Build Status](https://travis-ci.org/auraphp/Aura.Di.png?branch=develop-2)](https://travis-ci.org/auraphp/Aura.Di) -To run the unit tests at the command line, issue `phpunit -c tests/unit/`. (This requires [PHPUnit][] to be available as `phpunit`.) +To run the unit tests at the command line, issue `phpunit` at the package root. (This requires [PHPUnit][] to be available as `phpunit` and [Composer][] to be available as `composer`.) [PHPUnit]: http://phpunit.de/manual/ +[Composer]: http://getcomposer.org/ This library attempts to comply with [PSR-1][], [PSR-2][], and [PSR-4][]. If you notice compliance oversights, please send a patch via pull request. diff --git a/composer.json b/composer.json index 8a561288..abaebb2a 100644 --- a/composer.json +++ b/composer.json @@ -25,6 +25,11 @@ "Aura\\Di\\": "src/" } }, + "autoload-dev": { + "psr-4": { + "Aura\\Di\\": "tests/" + } + }, "extra": { "aura": { "type": "library" diff --git a/phpunit.php b/phpunit.php new file mode 100644 index 00000000..ece7436a --- /dev/null +++ b/phpunit.php @@ -0,0 +1,7 @@ + + - ./src + ./tests diff --git a/tests/container/src/AbstractContainerTest.php b/tests/AbstractContainerTest.php similarity index 100% rename from tests/container/src/AbstractContainerTest.php rename to tests/AbstractContainerTest.php diff --git a/tests/unit/src/ContainerBuilderTest.php b/tests/ContainerBuilderTest.php similarity index 100% rename from tests/unit/src/ContainerBuilderTest.php rename to tests/ContainerBuilderTest.php diff --git a/tests/container/src/ContainerTest.php b/tests/ContainerConfigTest.php similarity index 91% rename from tests/container/src/ContainerTest.php rename to tests/ContainerConfigTest.php index f53a62f6..85181c70 100644 --- a/tests/container/src/ContainerTest.php +++ b/tests/ContainerConfigTest.php @@ -1,7 +1,7 @@ - - - ./src - - - diff --git a/tests/unit/src/lazy_array.php b/tests/lazy_array.php similarity index 100% rename from tests/unit/src/lazy_array.php rename to tests/lazy_array.php diff --git a/tests/unit/bootstrap.php b/tests/unit/bootstrap.php deleted file mode 100644 index e142b596..00000000 --- a/tests/unit/bootstrap.php +++ /dev/null @@ -1,16 +0,0 @@ -