Skip to content

Commit eb00c1b

Browse files
authored
[9.x] Add test for assertSessionMissing method (#41696)
1 parent e47be73 commit eb00c1b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/Testing/TestResponseTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,6 +1702,18 @@ public function testAssertSessionHas()
17021702
$response->assertSessionHas(['foo', 'bar']);
17031703
}
17041704

1705+
public function testAssertSessionMissing()
1706+
{
1707+
$this->expectException(AssertionFailedError::class);
1708+
1709+
app()->instance('session.store', $store = new Store('test-session', new ArraySessionHandler(1)));
1710+
1711+
$store->put('foo', 'value');
1712+
1713+
$response = TestResponse::fromBaseResponse(new Response());
1714+
$response->assertSessionMissing('foo');
1715+
}
1716+
17051717
public function testAssertSessionHasInput()
17061718
{
17071719
app()->instance('session.store', $store = new Store('test-session', new ArraySessionHandler(1)));

0 commit comments

Comments
 (0)