Skip to content

Commit

Permalink
Send 404 response code
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Aug 16, 2014
1 parent 8bd3286 commit a880f1e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/Dispatcher/PageDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,14 @@ public function getPath($uri, &$fixedUri) {
if(!is_dir($pageViewDir)) {
$pageViewDir_container = dirname($pageViewDir);

if(!is_dir($pageViewDir_container)) {
if(is_dir($pageViewDir_container)) {
if(!file_exists($pageViewPath . $fixedUri)) {
throw new NotFoundException($fixedUri);
}
}
else {
throw new NotFoundException(
$pageViewDir
$fixedUri
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ Feature: Test that users see the page

Scenario: Open homepage
Given I go to the homepage
Then I should see "Test Page (Single Page Application)"
Then I should see "Test Page (Single Page Application)"

Scenario: Access invalid page
Given I go to "/invalid-page"
Then the response status code should be 404

0 comments on commit a880f1e

Please sign in to comment.