Skip to content

Commit 92ec080

Browse files
committed
Fix test that seems irrelevant...
1 parent 7554783 commit 92ec080

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

system/Test/FeatureTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ public function skipEvents()
151151
public function call(string $method, string $path, array $params = null)
152152
{
153153
// Simulate having a blank session
154-
$_SESSION = [];
154+
$_SESSION = [];
155+
$_SERVER['REQUEST_METHOD'] = $method;
155156

156157
$request = $this->setupRequest($method, $path, $params);
157158
$request = $this->populateGlobals($method, $request, $params);
@@ -165,7 +166,6 @@ public function call(string $method, string $path, array $params = null)
165166
// Make sure any other classes that might call the request
166167
// instance get the right one.
167168
Services::injectMock('request', $request);
168-
$_SERVER['REQUEST_METHOD'] = $method;
169169

170170
$response = $this->app
171171
->setRequest($request)

tests/system/Test/FeatureTestCaseTest.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,18 @@ function () {
137137

138138
public function testSession()
139139
{
140-
$response = $this->withSession([
141-
'fruit' => 'apple',
142-
'greeting' => 'hello',
143-
])->get('home');
140+
$response = $this->withRoutes([
141+
[
142+
'get',
143+
'home',
144+
function () {
145+
return 'Home';
146+
},
147+
],
148+
])->withSession([
149+
'fruit' => 'apple',
150+
'greeting' => 'hello',
151+
])->get('home');
144152

145153
$response->assertSessionHas('fruit', 'apple');
146154
$response->assertSessionMissing('popcorn');

0 commit comments

Comments
 (0)