From d93e7f484c07bc98ff184d100954e08f4015166b Mon Sep 17 00:00:00 2001 From: Haralan Dobrev Date: Mon, 21 Sep 2015 16:06:29 +0100 Subject: [PATCH] Use PSR-4 and autoload-dev - PSR-4 is the successor of PSR-0. PSR-0 is deprecated now. The provided autoloader does not respect the underscore rule from PSR-0 anyway. - `autoload-dev` is a feature of Composer to dump additional namespaces in the autoloader when dev dependencies are being installed. This way there is no need to have a separate bootstrap file for PHPUnit. --- README.md | 2 +- composer.json | 5 ++++- phpunit.xml.dist | 2 +- tests/bootstrap.php | 4 ---- 4 files changed, 6 insertions(+), 7 deletions(-) delete mode 100644 tests/bootstrap.php diff --git a/README.md b/README.md index 8762293..d16e852 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,7 @@ Unit Tests Setup the test suite using Composer: - $ composer install --dev + $ composer install Run it using PHPUnit: diff --git a/composer.json b/composer.json index f89b861..b6c1cc2 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,10 @@ "php": ">=5.3.0" }, "autoload": { - "psr-0": { "EmailReplyParser": "src/" } + "psr-4": { "EmailReplyParser\\": "src/EmailReplyParser" } + }, + "autoload-dev": { + "psr-4": { "EmailReplyParser\\Tests\\": "tests/EmailReplyParser/Tests" } }, "extra": { "branch-alias": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index abcaf3e..d191896 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -8,7 +8,7 @@ processIsolation="false" stopOnFailure="false" syntaxCheck="false" - bootstrap="tests/bootstrap.php" + bootstrap="vendor/autoload.php" > diff --git a/tests/bootstrap.php b/tests/bootstrap.php deleted file mode 100644 index a3165db..0000000 --- a/tests/bootstrap.php +++ /dev/null @@ -1,4 +0,0 @@ -add('EmailReplyParser\Tests', __DIR__);