Skip to content

Commit

Permalink
Added Test Case
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanAtG2 committed Nov 1, 2016
1 parent a0ed920 commit ae1f39a
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/Dispatcher/DispatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ public function getParameterOptionalRequired($param, $param2 = 'default')
}
}

class DefaultTest{
function getIndex($one, $two = false){
return "getIndex";
}

function postIndex($one) {
return "postIndex";
}
}

class DispatcherTest extends \PHPUnit_Framework_TestCase {

/**
Expand Down Expand Up @@ -1068,5 +1078,21 @@ public function provideMethodNotAllowedDispatchCases()

return $cases;
}

public function testDefaultControllerActions(){
$r = $this->router();

$r->controller('testDefault', __NAMESPACE__.'\\DefaultTest');

try {
$this->dispatch($r, Route::POST, 'testDefault/test');
$this->dispatch($r, Route::GET, 'testDefault/test');
} catch (\Phroute\Phroute\Exception\HttpMethodNotAllowedException $ex) {
$this->fail('Should not throw exception '.get_class($ex));
}



}

}

0 comments on commit ae1f39a

Please sign in to comment.