@@ -10,6 +10,11 @@ class AbstractEndpointTest extends \PHPUnit\Framework\TestCase
10
10
{
11
11
private $ endpoint ;
12
12
13
+ protected function setUp ()
14
+ {
15
+ $ this ->endpoint = $ this ->getMockForAbstractClass (AbstractEndpoint::class);
16
+ }
17
+
13
18
public static function invalidParameters (): array
14
19
{
15
20
return [
@@ -20,6 +25,8 @@ public static function invalidParameters(): array
20
25
21
26
/**
22
27
* @dataProvider invalidParameters
28
+ *
29
+ * @covers AbstractEndpoint::setParams
23
30
*/
24
31
public function testInvalidParamsCauseErrorsWhenProvidedToSetParams (array $ params )
25
32
{
@@ -32,8 +39,22 @@ public function testInvalidParamsCauseErrorsWhenProvidedToSetParams(array $param
32
39
$ this ->endpoint ->setParams ($ params );
33
40
}
34
41
35
- protected function setUp ()
42
+ /**
43
+ * @covers AbstractEndpoint::setParams
44
+ * @covers AbstractEndpoint::extractOptions
45
+ * @covers AbstractEndpoint::getOptions
46
+ */
47
+ public function testOpaqueIdInHeaders ()
36
48
{
37
- $ this ->endpoint = $ this ->getMockForAbstractClass (AbstractEndpoint::class);
49
+ $ params = ['opaqueId ' => 'test_id_ ' . rand (1000 , 9999 )];
50
+ $ this ->endpoint ->setParams ($ params );
51
+
52
+ $ options = $ this ->endpoint ->getOptions ();
53
+ $ this ->assertArrayHasKey ('client ' , $ options );
54
+ $ this ->assertArrayHasKey ('headers ' , $ options ['client ' ]);
55
+ $ this ->assertArrayHasKey ('x-opaque-id ' , $ options ['client ' ]['headers ' ]);
56
+ $ this ->assertNotEmpty ($ options ['client ' ]['headers ' ]['x-opaque-id ' ]);
57
+ $ this ->assertEquals ($ params ['opaqueId ' ], $ options ['client ' ]['headers ' ]['x-opaque-id ' ][0 ]);
38
58
}
59
+
39
60
}
0 commit comments