Skip to content
This repository has been archived by the owner on Nov 2, 2018. It is now read-only.

Commit

Permalink
Added test class for Zepto\Route
Browse files Browse the repository at this point in the history
  • Loading branch information
hassankhan committed Jan 31, 2014
1 parent 21014fb commit ff5dbdf
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions tests/Zepto/RouteTest.php
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());
}
}

0 comments on commit ff5dbdf

Please sign in to comment.