Permalink
Browse files

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.
  • Loading branch information...
1 parent b9da621 commit d93e7f484c07bc98ff184d100954e08f4015166b @hkdobrev hkdobrev committed with Sep 21, 2015
Showing with 6 additions and 7 deletions.
  1. +1 −1 README.md
  2. +4 −1 composer.json
  3. +1 −1 phpunit.xml.dist
  4. +0 −4 tests/bootstrap.php
View
@@ -149,7 +149,7 @@ Unit Tests
Setup the test suite using Composer:
- $ composer install --dev
+ $ composer install
Run it using PHPUnit:
View
@@ -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": {
View
@@ -8,7 +8,7 @@
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
- bootstrap="tests/bootstrap.php"
+ bootstrap="vendor/autoload.php"
>
<testsuites>
<testsuite name="EmailReplyParser Test Suite">
View
@@ -1,4 +0,0 @@
-<?php
-
-$loader = require_once __DIR__ . '/../vendor/autoload.php';
-$loader->add('EmailReplyParser\Tests', __DIR__);

0 comments on commit d93e7f4

Please sign in to comment.