@@ 17-33 (lines=17) @@ | ||
14 | /** |
|
15 | * testFormAuthStrategy. |
|
16 | */ |
|
17 | public function testFormAuthStrategy() |
|
18 | { |
|
19 | $authStrategy = new FormAuthStrategy( |
|
20 | [ |
|
21 | 'username' => 'admin', |
|
22 | 'password' => 'admin', |
|
23 | 'form_fields' => ['login', 'password'], |
|
24 | ] |
|
25 | ); |
|
26 | ||
27 | $this->assertTrue(array_key_exists('login', $authStrategy->getRequestOptions()['form_params'])); |
|
28 | ||
29 | $this->assertTrue(array_key_exists('password', $authStrategy->getRequestOptions()['form_params'])); |
|
30 | ||
31 | $this->assertEquals('admin', $authStrategy->getRequestOptions()['form_params']['login']); |
|
32 | $this->assertEquals('admin', $authStrategy->getRequestOptions()['form_params']['password']); |
|
33 | } |
|
34 | ||
35 | /** |
|
36 | * tesQueryAuthStrategy. |
|
@@ 38-53 (lines=16) @@ | ||
35 | /** |
|
36 | * tesQueryAuthStrategy. |
|
37 | */ |
|
38 | public function testQueryAuthStrategy() |
|
39 | { |
|
40 | $authStrategy = new QueryAuthStrategy( |
|
41 | [ |
|
42 | 'username' => 'admin', |
|
43 | 'password' => 'admin', |
|
44 | 'query_fields' => ['username', 'password'], |
|
45 | ] |
|
46 | ); |
|
47 | ||
48 | $this->assertTrue(array_key_exists('username', $authStrategy->getRequestOptions()['query'])); |
|
49 | $this->assertTrue(array_key_exists('password', $authStrategy->getRequestOptions()['query'])); |
|
50 | ||
51 | $this->assertEquals('admin', $authStrategy->getRequestOptions()['query']['username']); |
|
52 | $this->assertEquals('admin', $authStrategy->getRequestOptions()['query']['password']); |
|
53 | } |
|
54 | ||
55 | /** |
|
56 | * testHttpBasicAuthStrategy. |