Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 93e8614

Browse files
Add test for domain specific routes
1 parent 215e9e9 commit 93e8614

File tree

5 files changed

+79
-96
lines changed

5 files changed

+79
-96
lines changed

‎app/Http/routes.php‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@
2525
'auth' => 'Auth\AuthController',
2626
'password' => 'Auth\PasswordController',
2727
]);
28+
29+
Route::get('domain-route', ['domain' => 'example.com', 'as' => 'domain', 'uses' => function() {
30+
return 'Domain route';
31+
}]);

‎composer.json‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66
"type": "project",
77
"require": {
88
"laravel/framework": "5.0.*",
9-
"illuminate/html": "5.0.*"
9+
"illuminate/html": "5.0.*"
1010
},
1111
"require-dev": {
1212
"phpunit/phpunit": "~4.0",
1313
"phpspec/phpspec": "~2.1",
14-
"codeception/codeception": "*",
15-
"janhenkgerritsen/codeception-laravel5": "*"
14+
"codeception/codeception": "~2.0"
1615
},
1716
"autoload": {
1817
"classmap": [
@@ -40,8 +39,5 @@
4039
"php -r \"copy('.env.example', '.env');\"",
4140
"php artisan key:generate"
4241
]
43-
},
44-
"config": {
45-
"preferred-install": "dist"
4642
}
4743
}

‎composer.lock‎

Lines changed: 39 additions & 81 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/api/ApiTester.php‎

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php //[STAMP] 95e1f2b9867198c4e7858be585c76d10
1+
<?php //[STAMP] a7b8f40aca0301fe2ac94b00b5b9b0a6
22

33
// This class was automatically generated by build task
44
// You should not change it manually as it will be overwritten on next build
@@ -2766,6 +2766,31 @@ public function seeResponseJsonMatchesJsonPath($jsonPath) {
27662766
}
27672767

27682768

2769+
/**
2770+
* [!] Method is generated. Documentation taken from corresponding module.
2771+
*
2772+
* Opposite to seeResponseJsonMatchesJsonPath
2773+
*
2774+
* @param array $jsonPath
2775+
* Conditional Assertion: Test won't be stopped on fail
2776+
* @see \Codeception\Module\REST::dontSeeResponseJsonMatchesJsonPath()
2777+
*/
2778+
public function cantSeeResponseJsonMatchesJsonPath($jsonPath) {
2779+
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeResponseJsonMatchesJsonPath', func_get_args()));
2780+
}
2781+
/**
2782+
* [!] Method is generated. Documentation taken from corresponding module.
2783+
*
2784+
* Opposite to seeResponseJsonMatchesJsonPath
2785+
*
2786+
* @param array $jsonPath
2787+
* @see \Codeception\Module\REST::dontSeeResponseJsonMatchesJsonPath()
2788+
*/
2789+
public function dontSeeResponseJsonMatchesJsonPath($jsonPath) {
2790+
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeResponseJsonMatchesJsonPath', func_get_args()));
2791+
}
2792+
2793+
27692794
/**
27702795
* [!] Method is generated. Documentation taken from corresponding module.
27712796
*

‎tests/functional/RoutesCest.php‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,7 @@
22

33
class RoutesCest
44
{
5-
public function _before(FunctionalTester $I)
6-
{
7-
}
8-
9-
public function _after(FunctionalTester $I)
10-
{
11-
}
125

13-
// tests
146
public function openPageByRoute(FunctionalTester $I)
157
{
168
$I->amOnRoute('posts.index');
@@ -24,4 +16,12 @@ public function openPageByAction(FunctionalTester $I)
2416
$I->seeCurrentUrlEquals('/posts');
2517
$I->seeCurrentRouteIs('posts.index');
2618
}
19+
20+
public function openRouteWithDomainSpecified(FunctionalTester $I)
21+
{
22+
$I->amOnRoute('domain');
23+
$I->seeResponseCodeIs(200);
24+
$I->see('Domain route');
25+
}
26+
2727
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /