Skip to content

Commit

Permalink
New test for reverse routing and closures for #568
Browse files Browse the repository at this point in the history
  • Loading branch information
lonnieezell committed Jun 23, 2017
1 parent 1b134d9 commit 16f6892
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions tests/system/Router/RouteCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -562,9 +562,6 @@ public function testEnvironmentRestricts()

//--------------------------------------------------------------------

/**
* @group single
*/
public function testReverseRoutingFindsSimpleMatch()
{
$routes = new RouteCollection();
Expand Down Expand Up @@ -671,4 +668,22 @@ public function testWithSubdomain()
$this->assertEquals($expects, $routes->getRoutes());
}

//--------------------------------------------------------------------

/**
* @see https://github.com/bcit-ci/CodeIgniter4/issues/568
*/
public function testReverseRoutingWithClosure()
{
$routes = new RouteCollection();

$routes->add('login', function() {});

$match = $routes->reverseRoute('login');

$this->assertEquals('/login', $match);
}

//--------------------------------------------------------------------

}

0 comments on commit 16f6892

Please sign in to comment.