-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dc98a61
commit c17423b
Showing
6 changed files
with
100 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--TEST-- | ||
phpunit --testdox RouterTest ../_files/RouterTest.php | ||
--FILE-- | ||
<?php | ||
$_SERVER['argv'][1] = '--no-configuration'; | ||
$_SERVER['argv'][2] = '--testdox'; | ||
$_SERVER['argv'][3] = 'RouterTest'; | ||
$_SERVER['argv'][4] = __DIR__ . '/../_files/RouterTest.php'; | ||
|
||
require __DIR__ . '/../bootstrap.php'; | ||
PHPUnit\TextUI\Command::main(); | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann and contributors. | ||
|
||
Router | ||
✔ Routes /foo/bar to FooBarHandler | ||
|
||
Time: %s, Memory: %s | ||
|
||
OK (1 test, 1 assertion) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php declare(strict_types=1); | ||
/* | ||
* This file is part of PHPUnit. | ||
* | ||
* (c) Sebastian Bergmann <sebastian@phpunit.de> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
final class RouterTest extends TestCase | ||
{ | ||
/** | ||
* @dataProvider routesProvider | ||
* @testdox Routes $url to $handler | ||
*/ | ||
public function testRoutesRequest(string $url, string $handler): void | ||
{ | ||
$this->assertTrue(true); | ||
} | ||
|
||
public function routesProvider() | ||
{ | ||
return [ | ||
'/foo/bar' => [ | ||
'/foo/bar', | ||
FooBarHandler::class, | ||
// ... | ||
] | ||
]; | ||
} | ||
} |