1 | <?php |
||
14 | class ServiceFactoryTest extends TestCase |
||
15 | { |
||
16 | /** |
||
17 | * @covers \OAuth\ServiceFactory::setHttpClient |
||
18 | */ |
||
19 | public function testSetHttpClient(): void |
||
28 | |||
29 | /** |
||
30 | * @covers \OAuth\ServiceFactory::registerService |
||
31 | */ |
||
32 | public function testRegisterServiceThrowsExceptionNonExistentClass(): void |
||
39 | |||
40 | /** |
||
41 | * @covers \OAuth\ServiceFactory::registerService |
||
42 | */ |
||
43 | public function testRegisterServiceThrowsExceptionWithClassIncorrectImplementation(): void |
||
50 | |||
51 | /** |
||
52 | * @covers \OAuth\ServiceFactory::registerService |
||
53 | */ |
||
54 | public function testRegisterServiceSuccessOAuth1(): void |
||
63 | |||
64 | /** |
||
65 | * @covers \OAuth\ServiceFactory::registerService |
||
66 | */ |
||
67 | public function testRegisterServiceSuccessOAuth2(): void |
||
76 | |||
77 | /** |
||
78 | * @covers \OAuth\ServiceFactory::buildV1Service |
||
79 | * @covers \OAuth\ServiceFactory::createService |
||
80 | * @covers \OAuth\ServiceFactory::getFullyQualifiedServiceName |
||
81 | */ |
||
82 | public function testCreateServiceOAuth1NonRegistered(): void |
||
94 | |||
95 | /** |
||
96 | * @covers \OAuth\ServiceFactory::buildV1Service |
||
97 | * @covers \OAuth\ServiceFactory::createService |
||
98 | * @covers \OAuth\ServiceFactory::getFullyQualifiedServiceName |
||
99 | * @covers \OAuth\ServiceFactory::registerService |
||
100 | */ |
||
101 | public function testCreateServiceOAuth1Registered(): void |
||
116 | |||
117 | /** |
||
118 | * @covers \OAuth\ServiceFactory::buildV1Service |
||
119 | * @covers \OAuth\ServiceFactory::createService |
||
120 | * @covers \OAuth\ServiceFactory::getFullyQualifiedServiceName |
||
121 | * @covers \OAuth\ServiceFactory::registerService |
||
122 | */ |
||
123 | public function testCreateServiceOAuth1RegisteredAndNonRegisteredSameName(): void |
||
138 | |||
139 | /** |
||
140 | * @covers \OAuth\ServiceFactory::buildV2Service |
||
141 | * @covers \OAuth\ServiceFactory::createService |
||
142 | * @covers \OAuth\ServiceFactory::getFullyQualifiedServiceName |
||
143 | * @covers \OAuth\ServiceFactory::resolveScopes |
||
144 | */ |
||
145 | public function testCreateServiceOAuth2NonRegistered(): void |
||
157 | |||
158 | /** |
||
159 | * @covers \OAuth\ServiceFactory::buildV2Service |
||
160 | * @covers \OAuth\ServiceFactory::createService |
||
161 | * @covers \OAuth\ServiceFactory::getFullyQualifiedServiceName |
||
162 | * @covers \OAuth\ServiceFactory::resolveScopes |
||
163 | */ |
||
164 | public function testCreateServiceOAuth2Registered(): void |
||
179 | |||
180 | /** |
||
181 | * @covers \OAuth\ServiceFactory::buildV2Service |
||
182 | * @covers \OAuth\ServiceFactory::createService |
||
183 | * @covers \OAuth\ServiceFactory::getFullyQualifiedServiceName |
||
184 | * @covers \OAuth\ServiceFactory::resolveScopes |
||
185 | */ |
||
186 | public function testCreateServiceOAuth2RegisteredAndNonRegisteredSameName(): void |
||
201 | |||
202 | /** |
||
203 | * @covers \OAuth\ServiceFactory::buildV1Service |
||
204 | * @covers \OAuth\ServiceFactory::createService |
||
205 | * @covers \OAuth\ServiceFactory::getFullyQualifiedServiceName |
||
206 | * @covers \OAuth\ServiceFactory::registerService |
||
207 | */ |
||
208 | public function testCreateServiceThrowsExceptionOnPassingScopesToV1Service(): void |
||
223 | |||
224 | /** |
||
225 | * @covers \OAuth\ServiceFactory::createService |
||
226 | * @covers \OAuth\ServiceFactory::getFullyQualifiedServiceName |
||
227 | */ |
||
228 | public function testCreateServiceNonExistentService(): void |
||
240 | |||
241 | /** |
||
242 | * @covers \OAuth\ServiceFactory::buildV2Service |
||
243 | * @covers \OAuth\ServiceFactory::createService |
||
244 | * @covers \OAuth\ServiceFactory::getFullyQualifiedServiceName |
||
245 | * @covers \OAuth\ServiceFactory::registerService |
||
246 | * @covers \OAuth\ServiceFactory::resolveScopes |
||
247 | */ |
||
248 | public function testCreateServicePrefersOauth2(): void |
||
264 | |||
265 | /** |
||
266 | * @covers \OAuth\ServiceFactory::buildV2Service |
||
267 | * @covers \OAuth\ServiceFactory::createService |
||
268 | * @covers \OAuth\ServiceFactory::getFullyQualifiedServiceName |
||
269 | * @covers \OAuth\ServiceFactory::resolveScopes |
||
270 | */ |
||
271 | public function testCreateServiceOAuth2RegisteredWithClassConstantsAsScope(): void |
||
287 | |||
288 | /** |
||
289 | * @covers \OAuth\ServiceFactory::buildV2Service |
||
290 | * @covers \OAuth\ServiceFactory::createService |
||
291 | * @covers \OAuth\ServiceFactory::getFullyQualifiedServiceName |
||
292 | * @covers \OAuth\ServiceFactory::resolveScopes |
||
293 | */ |
||
294 | public function testCreateServiceOAuth2RegisteredWithCustomScope(): void |
||
310 | } |
||
311 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: