Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Mar 12, 2020
1 parent d8de232 commit 9a66e76
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/EnsureFrontendRequestsAreStatefulTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class EnsureFrontendRequestsAreStatefulTest extends TestCase
{
protected function getEnvironmentSetUp($app)
{
$app['config']->set('airlock.stateful', 'test.com');
$app['config']->set('airlock.stateful', ['test.com', '*.test.com']);
}

public function test_request_referer_is_parsed_against_configuration()
Expand All @@ -27,6 +27,14 @@ public function test_request_referer_is_parsed_against_configuration()
$this->assertFalse(EnsureFrontendRequestsAreStateful::fromFrontend($request));
}

public function test_wildcard_matching()
{
$request = Request::create('/');
$request->headers->set('referer', 'https://foo.test.com');

$this->assertTrue(EnsureFrontendRequestsAreStateful::fromFrontend($request));
}

protected function getPackageProviders($app)
{
return [AirlockServiceProvider::class];
Expand Down

0 comments on commit 9a66e76

Please sign in to comment.