Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.x] Add withToken() helper method #33075

Merged
merged 5 commits into from
Jun 3, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update test
aryehraber committed Jun 2, 2020
commit bf0835c7a0737920af11bcb5e99c7a795f2a63dd
8 changes: 5 additions & 3 deletions tests/Foundation/Testing/Concerns/MakesHttpRequestsTest.php
Original file line number Diff line number Diff line change
@@ -14,11 +14,13 @@ public function testFromSetsHeaderAndSession()
$this->assertSame('previous/url', $this->app['session']->previousUrl());
}

public function testBearerTokenSetsHeader()
public function testWithTokenSetsAuthorizationHeader()
{
$this->withBearerToken('foobar');

$this->withToken('foobar');
$this->assertSame('Bearer foobar', $this->defaultHeaders['Authorization']);

$this->withToken('foobar', 'Basic');
$this->assertSame('Basic foobar', $this->defaultHeaders['Authorization']);
}

public function testWithoutAndWithMiddleware()