Skip to content

Commit

Permalink
add use at top and use assertNull
Browse files Browse the repository at this point in the history
  • Loading branch information
Elias De Vos committed Jan 16, 2018
1 parent c5934fa commit ffe1131
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Routing/Router.php
Expand Up @@ -17,6 +17,7 @@
use Cake\Core\Configure;
use Cake\Http\ServerRequest;
use Cake\Utility\Inflector;
use Cake\Routing\Exception\MissingRouteException;
use Psr\Http\Message\ServerRequestInterface;

/**
Expand Down Expand Up @@ -725,7 +726,7 @@ public static function urlOrNull($url = null, $full = false)
{
try {
return static::url($url, $full);
} catch (\Cake\Routing\Exception\MissingRouteException $e) {
} catch (MissingRouteException $e) {
return null;
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Routing/RouterTest.php
Expand Up @@ -139,7 +139,7 @@ public function testRouteUrlOrNull()
Router::connect('/:controller/:action', ['controller' => 'posts']);
$this->assertEquals(Router::urlOrNull(['action' => 'view']), '/view');

$this->assertEquals(Router::urlOrNull(['action' => 'view', 'controller' => 'users', 'plugin' => 'test']), null);
$this->assertNull(Router::urlOrNull(['action' => 'view', 'controller' => 'users', 'plugin' => 'test']));
}

/**
Expand Down

0 comments on commit ffe1131

Please sign in to comment.