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

Appearance settings

Commit 190258f

Browse filesBrowse files
committed
Fix CS. Add a test.
1 parent 1293cfe commit 190258f
Copy full SHA for 190258f

File tree

1 file changed

+9
-1
lines changed
Filter options

1 file changed

+9
-1
lines changed

‎src/Symfony/Component/HttpClient/Tests/HttpClientTraitTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpClient/Tests/HttpClientTraitTest.php
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\HttpClient\Tests;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Symfony\Component\HttpClient\HttpClient;
1615
use Symfony\Component\HttpClient\HttpClientTrait;
1716
use Symfony\Contracts\HttpClient\HttpClientInterface;
1817

@@ -172,4 +171,13 @@ public function testBearerOption()
172171
$this->assertSame('Bearer foobar', $options['headers']['authorization'][0]);
173172
$this->assertSame('authorization: Bearer foobar', $options['raw_headers'][0]);
174173
}
174+
175+
/**
176+
* @expectedException \Symfony\Component\HttpClient\Exception\InvalidArgumentException
177+
* @expectedExceptionMessage Option "bearer" must be string, object given.
178+
*/
179+
public function testInvalidBearerOption()
180+
{
181+
self::prepareRequest('POST', 'http://example.com', ['bearer' => new \stdClass()], HttpClientInterface::OPTIONS_DEFAULTS);
182+
}
175183
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.