diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8dfe4d1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +composer.phar +vendor/ + +# Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +composer.lock diff --git a/composer.json b/composer.json index 22afd35..89456e7 100644 --- a/composer.json +++ b/composer.json @@ -16,5 +16,8 @@ }, "autoload": { "files": [ "flight/autoload.php", "flight/Flight.php" ] + }, + "require-dev": { + "phpunit/phpunit": "~4.6" } } diff --git a/tests/AutoloadTest.php b/tests/AutoloadTest.php index 3fef4da..c8dd4df 100644 --- a/tests/AutoloadTest.php +++ b/tests/AutoloadTest.php @@ -6,7 +6,7 @@ * @license MIT, http://flightphp.com/license */ -require_once 'PHPUnit/Autoload.php'; +require_once 'vendor/autoload.php'; require_once __DIR__.'/../flight/autoload.php'; class AutoloadTest extends PHPUnit_Framework_TestCase @@ -15,7 +15,7 @@ class AutoloadTest extends PHPUnit_Framework_TestCase * @var \flight\Engine */ private $app; - + function setUp() { $this->app = new \flight\Engine(); $this->app->path(__DIR__.'/classes'); diff --git a/tests/DispatcherTest.php b/tests/DispatcherTest.php index 56e9acf..a29bd20 100644 --- a/tests/DispatcherTest.php +++ b/tests/DispatcherTest.php @@ -6,7 +6,7 @@ * @license MIT, http://flightphp.com/license */ -require_once 'PHPUnit/Autoload.php'; +require_once 'vendor/autoload.php'; require_once __DIR__.'/classes/Hello.php'; class DispatcherTest extends PHPUnit_Framework_TestCase diff --git a/tests/FilterTest.php b/tests/FilterTest.php index d97ed42..6fef654 100644 --- a/tests/FilterTest.php +++ b/tests/FilterTest.php @@ -6,7 +6,7 @@ * @license MIT, http://flightphp.com/license */ -require_once 'PHPUnit/Autoload.php'; +require_once 'vendor/autoload.php'; require_once __DIR__.'/../flight/autoload.php'; class FilterTest extends PHPUnit_Framework_TestCase diff --git a/tests/FlightTest.php b/tests/FlightTest.php index 570bf41..0c286a9 100644 --- a/tests/FlightTest.php +++ b/tests/FlightTest.php @@ -6,7 +6,7 @@ * @license MIT, http://flightphp.com/license */ -require_once 'PHPUnit/Autoload.php'; +require_once 'vendor/autoload.php'; require_once __DIR__.'/../flight/Flight.php'; class FlightTest extends PHPUnit_Framework_TestCase diff --git a/tests/LoaderTest.php b/tests/LoaderTest.php index 00219d4..98de2bd 100644 --- a/tests/LoaderTest.php +++ b/tests/LoaderTest.php @@ -6,7 +6,7 @@ * @license MIT, http://flightphp.com/license */ -require_once 'PHPUnit/Autoload.php'; +require_once 'vendor/autoload.php'; require_once __DIR__.'/classes/User.php'; require_once __DIR__.'/classes/Factory.php'; diff --git a/tests/MapTest.php b/tests/MapTest.php index f5cdc9f..12b0828 100644 --- a/tests/MapTest.php +++ b/tests/MapTest.php @@ -6,7 +6,7 @@ * @license MIT, http://flightphp.com/license */ -require_once 'PHPUnit/Autoload.php'; +require_once 'vendor/autoload.php'; require_once __DIR__.'/../flight/autoload.php'; require_once __DIR__.'/classes/Hello.php'; diff --git a/tests/README.md b/tests/README.md index fc7ea76..35efc20 100644 --- a/tests/README.md +++ b/tests/README.md @@ -4,6 +4,7 @@ This directory contains unit tests for Flight. The tests were written for PHPUni To run the tests do: - phpunit tests + composer install + vendor/bin/phpunit tests -Learn more about PHPUnit at [http://www.phpunit.de](http://www.phpunit.de/manual/current/en/index.html) \ No newline at end of file +Learn more about PHPUnit at [http://www.phpunit.de](http://www.phpunit.de/manual/current/en/index.html) diff --git a/tests/RedirectTest.php b/tests/RedirectTest.php index fb43219..9a5dae1 100644 --- a/tests/RedirectTest.php +++ b/tests/RedirectTest.php @@ -6,7 +6,7 @@ * @license MIT, http://flightphp.com/license */ -require_once 'PHPUnit/Autoload.php'; +require_once 'vendor/autoload.php'; require_once __DIR__.'/../flight/autoload.php'; class RedirectTest extends PHPUnit_Framework_TestCase diff --git a/tests/RegisterTest.php b/tests/RegisterTest.php index bc57414..37ec2b6 100644 --- a/tests/RegisterTest.php +++ b/tests/RegisterTest.php @@ -6,7 +6,7 @@ * @license MIT, http://flightphp.com/license */ -require_once 'PHPUnit/Autoload.php'; +require_once 'vendor/autoload.php'; require_once __DIR__.'/../flight/autoload.php'; require_once __DIR__.'/classes/User.php'; @@ -84,4 +84,4 @@ class RegisterTest extends PHPUnit_Framework_TestCase $this->assertEquals(123, $user); } -} \ No newline at end of file +} diff --git a/tests/RenderTest.php b/tests/RenderTest.php index 7507a15..7d20d1e 100644 --- a/tests/RenderTest.php +++ b/tests/RenderTest.php @@ -6,7 +6,7 @@ * @license MIT, http://flightphp.com/license */ -require_once 'PHPUnit/Autoload.php'; +require_once 'vendor/autoload.php'; require_once __DIR__.'/../flight/Flight.php'; class RenderTest extends PHPUnit_Framework_TestCase diff --git a/tests/RequestTest.php b/tests/RequestTest.php index ca32829..1c6d144 100644 --- a/tests/RequestTest.php +++ b/tests/RequestTest.php @@ -6,7 +6,7 @@ * @license MIT, http://flightphp.com/license */ -require_once 'PHPUnit/Autoload.php'; +require_once 'vendor/autoload.php'; require_once __DIR__.'/../flight/autoload.php'; class RequestTest extends PHPUnit_Framework_TestCase diff --git a/tests/RouterTest.php b/tests/RouterTest.php index 0dca312..6a129d8 100644 --- a/tests/RouterTest.php +++ b/tests/RouterTest.php @@ -6,7 +6,7 @@ * @license MIT, http://flightphp.com/license */ -require_once 'PHPUnit/Autoload.php'; +require_once 'vendor/autoload.php'; require_once __DIR__.'/../flight/autoload.php'; class RouterTest extends PHPUnit_Framework_TestCase @@ -20,7 +20,7 @@ class RouterTest extends PHPUnit_Framework_TestCase * @var \flight\net\Request */ private $request; - + function setUp(){ $this->router = new \flight\net\Router(); $this->request = new \flight\net\Request(); diff --git a/tests/VariableTest.php b/tests/VariableTest.php index 15a34be..8c2fc0c 100644 --- a/tests/VariableTest.php +++ b/tests/VariableTest.php @@ -6,7 +6,7 @@ * @license MIT, http://flightphp.com/license */ -require_once 'PHPUnit/Autoload.php'; +require_once 'vendor/autoload.php'; require_once __DIR__.'/../flight/autoload.php'; class VariableTest extends PHPUnit_Framework_TestCase diff --git a/tests/ViewTest.php b/tests/ViewTest.php index ebab5d7..4e44975 100644 --- a/tests/ViewTest.php +++ b/tests/ViewTest.php @@ -6,7 +6,7 @@ * @license MIT, http://flightphp.com/license */ -require_once 'PHPUnit/Autoload.php'; +require_once 'vendor/autoload.php'; require_once __DIR__.'/../flight/autoload.php'; class ViewTest extends PHPUnit_Framework_TestCase