Permalink
Browse files

fix currentRoute() when $_currentRoute is empty, return false

  • Loading branch information...
1 parent 720dc5e commit 4aabf72e1fbfc2e5e3d0a589b0a919ab0a094f98 @zoghal zoghal committed Apr 26, 2013
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/Cake/Test/Case/Routing/RouterTest.php
@@ -2162,6 +2162,16 @@ public function testStripPlugin() {
}
/**
+ * testCurrentRouteWhenNonExistentRoute
+ *
+ * @return void
+ */
+ public function testCurrentRouteWhenNonExistentRoute() {
+ $route = Router::currentRoute();
+ $this->assertFalse($route);
+ }
+
+/**
* testCurrentRoute
*
* This test needs some improvement and actual requestAction() usage

0 comments on commit 4aabf72

Please sign in to comment.