summaryrefslogtreecommitdiffstats
path: root/tests/Router/Runner/RunnerFactoryTest.php
diff options
context:
space:
mode:
authorArnold Daniels <arnold@jasny.net>2016-11-03 23:45:36 +0100
committerGitHub <noreply@github.com>2016-11-03 23:45:36 +0100
commitf3d05dfca77843a869e938028824f19307780939 (patch)
tree846c5e559360e530d200d897f67b5af02f8795e5 /tests/Router/Runner/RunnerFactoryTest.php
parentaa31c40618b0cc7b43b7a1cb107e97b49e2c06f1 (diff)
parentbd4cb77fbf04923fa31a08fdd1f33f2c0db87864 (diff)
downloadrouter-1.0.0.zip
router-1.0.0.tar.gz
router-1.0.0.tar.bz2
Merge pull request #13 from jasny/fix-testsv1.0.0
Fix tests
Diffstat (limited to 'tests/Router/Runner/RunnerFactoryTest.php')
-rw-r--r--tests/Router/Runner/RunnerFactoryTest.php41
1 files changed, 0 insertions, 41 deletions
diff --git a/tests/Router/Runner/RunnerFactoryTest.php b/tests/Router/Runner/RunnerFactoryTest.php
deleted file mode 100644
index c18656d..0000000
--- a/tests/Router/Runner/RunnerFactoryTest.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-
-use Jasny\Router\Route;
-use Jasny\Router\Runner\RunnerFactory;
-use Jasny\Router\Runner\Controller;
-use Jasny\Router\Runner\Callback;
-use Jasny\Router\Runner\PhpScript;
-
-class RunnerFactoryTest extends PHPUnit_Framework_TestCase
-{
- /**
- * Test creating Runner object using factory
- *
- * @dataProvider createProvider
- * @param Route $route
- * @param string $class Runner class to use
- * @param boolean $positive
- */
- public function testCreate($route, $class, $positive)
- {
- if (!$positive) $this->expectException(\InvalidArgumentException::class);
-
- $factory = new RunnerFactory();
- $runner = $factory($route);
-
- $this->assertInstanceOf($class, $runner, "Runner object has invalid class");
- }
-
- /**
- * Provide data fpr testing 'create' method
- */
- public function createProvider()
- {
- return [
- [Route::create(['controller' => 'TestController', 'value' => 'test']), Controller::class, true],
- [Route::create(['fn' => 'testFunction', 'value' => 'test']), Callback::class, true],
- [Route::create(['file' => 'some_file.php', 'value' => 'test']), PhpScript::class, true],
- [Route::create(['test' => 'test']), '', false],
- ];
- }
-}