From 1ac5cee0a2818c1aab6d4c003897108c3eac7577 Mon Sep 17 00:00:00 2001 From: Chris Saylor Date: Thu, 19 Sep 2013 21:43:58 -0400 Subject: [PATCH] Cleaned up composer setup and removed custom autoloader. --- .gitignore | 3 +++ .travis.yml | 6 ++++-- README.md | 8 +++----- composer.json | 10 +++++++--- phpunit.xml | 11 ++-------- .../PHPUnit/Extensions/Mongo/AutoLoader.php | 20 ------------------- 6 files changed, 19 insertions(+), 39 deletions(-) create mode 100644 .gitignore delete mode 100644 src/Zumba/PHPUnit/Extensions/Mongo/AutoLoader.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4cda1c1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +vendor/ +bin/ +composer.lock \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 24be4d9..c852faf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,9 +10,11 @@ env: - MONGO_VERSION=1.3.1 before_script: - - pecl -q install mongo-${MONGO_VERSION} && echo "extension=mongo.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` + - pecl -q install mongo-${MONGO_VERSION} && echo "extension=mongo.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` + - composer install --dev -script: phpunit --coverage-text + +script: ./bin/phpunit --coverage-text notifications: email: false diff --git a/README.md b/README.md index 9a9f921..7a6b50c 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,6 @@ __Current Version__: v1.1 ## Testing -After cloning the repo, simply `cd` to the cloned directly and run: - -```shell -$ phpunit -``` +1. Clone repo. +1. Install dependencies `composer install -dev` +1. Run `./bin/phpunit` diff --git a/composer.json b/composer.json index 7aa0bcf..1713594 100644 --- a/composer.json +++ b/composer.json @@ -22,9 +22,11 @@ }, "require": { "php": ">=5.3.0", - "phpunit/phpunit": ">=3.7.0", "ext-mongo": "*" }, + "require-dev": { + "phpunit/phpunit": "3.7.*" + }, "bin": [ "composer/bin/mongounit" ], @@ -32,6 +34,8 @@ "bin-dir": "bin" }, "autoload": { - "files": ["src/Zumba/PHPUnit/Extensions/Mongo/AutoLoader.php"] + "psr-0": { + "Zumba\\PHPUnit\\Extensions\\Mongo\\": "src/" + } } -} \ No newline at end of file +} diff --git a/phpunit.xml b/phpunit.xml index 2766496..a0c3ae4 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,7 +1,7 @@ - - ./src/Zumba/PHPUnit/Extensions/Mongo/AutoLoader.php - ./tests - ./src/Zumba/PHPUnit - - ./src/Zumba/PHPUnit/Extensions/Mongo/AutoLoader.php - - \ No newline at end of file + diff --git a/src/Zumba/PHPUnit/Extensions/Mongo/AutoLoader.php b/src/Zumba/PHPUnit/Extensions/Mongo/AutoLoader.php deleted file mode 100644 index 3fc1136..0000000 --- a/src/Zumba/PHPUnit/Extensions/Mongo/AutoLoader.php +++ /dev/null @@ -1,20 +0,0 @@ - array(dirname(dirname(dirname(dirname(__DIR__)))) . '/') - ); - $classname = ltrim($classname, '\\'); - foreach ($namespaces as $ns => $paths) { - foreach ($paths as $path) { - $path .= str_replace('\\', DIRECTORY_SEPARATOR, $classname) . '.php'; - if (!file_exists($path)) { - continue; - } - return include $path; - } - } - return false; -}); \ No newline at end of file