Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I went with a testing approach that's little more high level (matching the Application __toString() output), and initiates the resources like in the "Tyrell" example.
- Loading branch information
Showing
4 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Feature: Issue 154 | ||
In order to make sure issue #154 (https://github.com/peej/tonic/issues/154) is fixed | ||
As a Tonic developer | ||
I want to test the problems in the issue | ||
|
||
Scenario: Resource without a URI annotation | ||
Given a resource file "issues/Issue154/*.php" to load | ||
And the request URI of "/issue154" | ||
When I create an application object | ||
And load the resource | ||
Then the application has a resource for class "Issue154\WithAnnotation", URI "/issue154", and priority 1 | ||
And the application does not have a resource for class "Issue154\WithoutAnnotation" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
namespace Issue154; | ||
|
||
require_once __DIR__ . '/WithoutAnnotation.php'; | ||
|
||
/** | ||
* @uri /issue154 | ||
*/ | ||
class WithAnnotation extends WithoutAnnotation { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
namespace Issue154; | ||
|
||
use Tonic\Resource; | ||
|
||
/** | ||
* WITHOUT @uri /issue154 | ||
*/ | ||
class WithoutAnnotation extends Resource { | ||
|
||
} |