added phpunit to composer and tests updated

pull/185/head
Yuri Tkachenko 10 years ago
parent e715471a2c
commit 83ffddc800

6
.gitignore vendored

@ -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

@ -16,5 +16,8 @@
}, },
"autoload": { "autoload": {
"files": [ "flight/autoload.php", "flight/Flight.php" ] "files": [ "flight/autoload.php", "flight/Flight.php" ]
},
"require-dev": {
"phpunit/phpunit": "~4.6"
} }
} }

@ -6,7 +6,7 @@
* @license MIT, http://flightphp.com/license * @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__.'/../flight/autoload.php';
class AutoloadTest extends PHPUnit_Framework_TestCase class AutoloadTest extends PHPUnit_Framework_TestCase
@ -15,7 +15,7 @@ class AutoloadTest extends PHPUnit_Framework_TestCase
* @var \flight\Engine * @var \flight\Engine
*/ */
private $app; private $app;
function setUp() { function setUp() {
$this->app = new \flight\Engine(); $this->app = new \flight\Engine();
$this->app->path(__DIR__.'/classes'); $this->app->path(__DIR__.'/classes');

@ -6,7 +6,7 @@
* @license MIT, http://flightphp.com/license * @license MIT, http://flightphp.com/license
*/ */
require_once 'PHPUnit/Autoload.php'; require_once 'vendor/autoload.php';
require_once __DIR__.'/classes/Hello.php'; require_once __DIR__.'/classes/Hello.php';
class DispatcherTest extends PHPUnit_Framework_TestCase class DispatcherTest extends PHPUnit_Framework_TestCase

@ -6,7 +6,7 @@
* @license MIT, http://flightphp.com/license * @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__.'/../flight/autoload.php';
class FilterTest extends PHPUnit_Framework_TestCase class FilterTest extends PHPUnit_Framework_TestCase

@ -6,7 +6,7 @@
* @license MIT, http://flightphp.com/license * @license MIT, http://flightphp.com/license
*/ */
require_once 'PHPUnit/Autoload.php'; require_once 'vendor/autoload.php';
require_once __DIR__.'/../flight/Flight.php'; require_once __DIR__.'/../flight/Flight.php';
class FlightTest extends PHPUnit_Framework_TestCase class FlightTest extends PHPUnit_Framework_TestCase

@ -6,7 +6,7 @@
* @license MIT, http://flightphp.com/license * @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/User.php';
require_once __DIR__.'/classes/Factory.php'; require_once __DIR__.'/classes/Factory.php';

@ -6,7 +6,7 @@
* @license MIT, http://flightphp.com/license * @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__.'/../flight/autoload.php';
require_once __DIR__.'/classes/Hello.php'; require_once __DIR__.'/classes/Hello.php';

@ -4,6 +4,7 @@ This directory contains unit tests for Flight. The tests were written for PHPUni
To run the tests do: 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) Learn more about PHPUnit at [http://www.phpunit.de](http://www.phpunit.de/manual/current/en/index.html)

@ -6,7 +6,7 @@
* @license MIT, http://flightphp.com/license * @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__.'/../flight/autoload.php';
class RedirectTest extends PHPUnit_Framework_TestCase class RedirectTest extends PHPUnit_Framework_TestCase

@ -6,7 +6,7 @@
* @license MIT, http://flightphp.com/license * @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__.'/../flight/autoload.php';
require_once __DIR__.'/classes/User.php'; require_once __DIR__.'/classes/User.php';
@ -84,4 +84,4 @@ class RegisterTest extends PHPUnit_Framework_TestCase
$this->assertEquals(123, $user); $this->assertEquals(123, $user);
} }
} }

@ -6,7 +6,7 @@
* @license MIT, http://flightphp.com/license * @license MIT, http://flightphp.com/license
*/ */
require_once 'PHPUnit/Autoload.php'; require_once 'vendor/autoload.php';
require_once __DIR__.'/../flight/Flight.php'; require_once __DIR__.'/../flight/Flight.php';
class RenderTest extends PHPUnit_Framework_TestCase class RenderTest extends PHPUnit_Framework_TestCase

@ -6,7 +6,7 @@
* @license MIT, http://flightphp.com/license * @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__.'/../flight/autoload.php';
class RequestTest extends PHPUnit_Framework_TestCase class RequestTest extends PHPUnit_Framework_TestCase

@ -6,7 +6,7 @@
* @license MIT, http://flightphp.com/license * @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__.'/../flight/autoload.php';
class RouterTest extends PHPUnit_Framework_TestCase class RouterTest extends PHPUnit_Framework_TestCase
@ -20,7 +20,7 @@ class RouterTest extends PHPUnit_Framework_TestCase
* @var \flight\net\Request * @var \flight\net\Request
*/ */
private $request; private $request;
function setUp(){ function setUp(){
$this->router = new \flight\net\Router(); $this->router = new \flight\net\Router();
$this->request = new \flight\net\Request(); $this->request = new \flight\net\Request();

@ -6,7 +6,7 @@
* @license MIT, http://flightphp.com/license * @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__.'/../flight/autoload.php';
class VariableTest extends PHPUnit_Framework_TestCase class VariableTest extends PHPUnit_Framework_TestCase

@ -6,7 +6,7 @@
* @license MIT, http://flightphp.com/license * @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__.'/../flight/autoload.php';
class ViewTest extends PHPUnit_Framework_TestCase class ViewTest extends PHPUnit_Framework_TestCase

Loading…
Cancel
Save