7
7
8
8
class HelixGuzzleClientSpec extends ObjectBehavior
9
9
{
10
- function let ()
11
- {
12
- $ this ->beConstructedWith ('client-id ' );
13
- }
14
-
15
10
function it_should_have_correct_base_uri ()
16
11
{
12
+ $ this ->beConstructedThrough ('getClient ' , ['client-id ' ]);
13
+ $ this ->shouldHaveType ('\GuzzleHttp\Client ' );
14
+
17
15
/** @var Uri $uri */
18
16
$ uri = $ this ->getConfig ('base_uri ' );
19
17
$ uri ->getScheme ()->shouldBe ('https ' );
@@ -23,17 +21,22 @@ function it_should_have_correct_base_uri()
23
21
24
22
function it_should_have_client_id_header ()
25
23
{
24
+ $ this ->beConstructedThrough ('getClient ' , ['client-id ' ]);
25
+ $ this ->shouldHaveType ('\GuzzleHttp\Client ' );
26
26
$ this ->getConfig ('headers ' )->shouldHaveKeyWithValue ('Client-ID ' , 'client-id ' );
27
27
}
28
28
29
29
function it_should_have_json_content_type_header ()
30
30
{
31
+ $ this ->beConstructedThrough ('getClient ' , ['client-id ' ]);
32
+ $ this ->shouldHaveType ('\GuzzleHttp\Client ' );
31
33
$ this ->getConfig ('headers ' )->shouldHaveKeyWithValue ('Content-Type ' , 'application/json ' );
32
34
}
33
35
34
36
function it_should_have_passed_in_config_params_instead_of_defaults ()
35
37
{
36
- $ this ->beConstructedWith ('client-id ' , ['base_uri ' => 'https://different.url ' ]);
38
+ $ this ->beConstructedThrough ('getClient ' , ['client-id ' , ['base_uri ' => 'https://different.url ' ]]);
39
+ $ this ->shouldHaveType ('\GuzzleHttp\Client ' );
37
40
$ this ->getConfig ('base_uri ' )->getHost ()->shouldBe ('different.url ' );
38
41
}
39
42
}
0 commit comments