This repository has been archived by the owner on Nov 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
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
21014fb
commit ff5dbdf
Showing
1 changed file
with
56 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
namespace Zepto; | ||
|
||
/** | ||
* Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2014-01-30 at 20:18:22. | ||
*/ | ||
class RouteTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @var Route | ||
*/ | ||
protected $route; | ||
|
||
/** | ||
* Sets up the fixture, for example, opens a network connection. | ||
* This method is called before a test is executed. | ||
*/ | ||
protected function setUp() | ||
{ | ||
$this->route = new Route('/get/<:id|[0-9]>', function() { | ||
echo 'Test callback'; | ||
}); | ||
} | ||
|
||
/** | ||
* Tears down the fixture, for example, closes a network connection. | ||
* This method is called after a test is executed. | ||
*/ | ||
protected function tearDown() | ||
{ | ||
} | ||
|
||
/** | ||
* @covers Zepto\Route::url | ||
*/ | ||
public function testUrl() | ||
{ | ||
$this->assertEquals('/get/<:id|[0-9]>', $this->route->url()); | ||
} | ||
|
||
/** | ||
* @covers Zepto\Route::pattern | ||
*/ | ||
public function testPattern() | ||
{ | ||
$this->assertEquals('#^/get/(?P<id>[0-9])/$#', $this->route->pattern()); | ||
} | ||
|
||
/** | ||
* @covers Zepto\Route::callback | ||
*/ | ||
public function testCallback() | ||
{ | ||
$this->assertInstanceOf('Closure', $this->route->callback()); | ||
} | ||
} |