1 | <?php |
||
23 | class TokenAuthenticateTest extends TestCase |
||
24 | { |
||
25 | |||
26 | use ConfigTrait; |
||
27 | use FixturesTrait; |
||
28 | |||
29 | /** |
||
30 | * @var TokenAuthenticate |
||
31 | */ |
||
32 | public $token; |
||
33 | |||
34 | /** |
||
35 | * Sets up the fixture, for example, opens a network connection. |
||
36 | * This method is called before a test is executed. |
||
37 | */ |
||
38 | public function setUp() |
||
53 | |||
54 | /** |
||
55 | * Tears down the fixture, for example, closes a network connection. |
||
56 | * This method is called after a test is executed. |
||
57 | */ |
||
58 | public function tearDown() |
||
62 | |||
63 | /** |
||
64 | * test |
||
65 | * |
||
66 | * @return void |
||
67 | */ |
||
68 | public function testAuthenticateHappy() |
||
74 | |||
75 | /** |
||
76 | * test |
||
77 | * |
||
78 | * @return void |
||
79 | */ |
||
80 | public function testAuthenticateFail() |
||
94 | |||
95 | /** |
||
96 | * test |
||
97 | * |
||
98 | * @expectedException \OutOfBoundsException |
||
99 | * @expectedExceptionMessage Type wrong is not valid |
||
100 | * |
||
101 | */ |
||
102 | public function testAuthenticateWrongType() |
||
108 | |||
109 | /** |
||
110 | * test |
||
111 | * |
||
112 | * @expectedException \Cake\Http\Exception\ForbiddenException |
||
113 | * @expectedExceptionMessage SSL is required for ApiKey Authentication |
||
114 | * |
||
115 | */ |
||
116 | public function testAuthenticateRequireSSL() |
||
122 | |||
123 | /** |
||
124 | * test |
||
125 | * |
||
126 | */ |
||
127 | public function testAuthenticateRequireSSLNoKey() |
||
133 | |||
134 | /** |
||
135 | * test |
||
136 | * |
||
137 | * @return void |
||
138 | */ |
||
139 | public function testHeaderHappy() |
||
152 | |||
153 | /** |
||
154 | * test |
||
155 | * |
||
156 | * @return void |
||
157 | */ |
||
158 | public function testAuthenticateHeaderFail() |
||
171 | } |
||
172 |