Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Fix failing RouteMatch test
Browse files Browse the repository at this point in the history
  • Loading branch information
Xerkus committed Nov 16, 2017
1 parent b8b4ff1 commit f1ed732
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 80 deletions.
66 changes: 0 additions & 66 deletions test/Route/RouteMatchTest.php

This file was deleted.

19 changes: 5 additions & 14 deletions test/RouteMatchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,35 @@ class RouteMatchTest extends TestCase
{
public function testParamsAreStored()
{
$match = new RouteMatch(['foo' => 'bar']);
$match = new RouteMatch(null, ['foo' => 'bar']);

$this->assertEquals(['foo' => 'bar'], $match->getParams());
}

public function testMatchedRouteNameIsSet()
{
$match = new RouteMatch([]);
$match->setMatchedRouteName('foo');
$match = new RouteMatch('foo', []);

$this->assertEquals('foo', $match->getMatchedRouteName());
}

public function testSetParam()
{
$match = new RouteMatch([]);
$match->setParam('foo', 'bar');

$this->assertEquals(['foo' => 'bar'], $match->getParams());
}

public function testGetParam()
{
$match = new RouteMatch(['foo' => 'bar']);
$match = new RouteMatch(null, ['foo' => 'bar']);

$this->assertEquals('bar', $match->getParam('foo'));
}

public function testGetNonExistentParamWithoutDefault()
{
$match = new RouteMatch([]);
$match = new RouteMatch(null, []);

$this->assertNull($match->getParam('foo'));
}

public function testGetNonExistentParamWithDefault()
{
$match = new RouteMatch([]);
$match = new RouteMatch(null, []);

$this->assertEquals('bar', $match->getParam('foo', 'bar'));
}
Expand Down

0 comments on commit f1ed732

Please sign in to comment.