1 | <?php |
||
18 | class FunctionalTest extends WebTestCase |
||
19 | { |
||
20 | // @codingStandardsIgnoreStart |
||
21 | const PSK_TOKEN = AuthenticatorTest::TEST_TOKEN; |
||
22 | const HMAC_TOKEN = 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImtleVR3byJ9.eyJwcm4iOiJqb2huIiwiaXNzIjoiaHR0cDovL2FwaS5zZXJ2ZXIyLmNvbS9vYXV0aDIvdG9rZW4ifQ.vdGhD5E4Ibj2Tndlh_0pPgJsOuRUpAn1QYu5miB6qwjrXhKCicuTKOuC9x2_2ErUOApv5KiblYds_gcWONdGKx1tQyQa1dsuhrkiVn_VJAsaaix8nJiHAuNv-ukm8mnSWJoVuOcTQIQG8IaupviyphEAEdjrm9QQhvzERgdFUT4bdCdfywrC37oYEAH5bHpiiUK2UzyNuUIHwOP_gWODodbEWRJOxtefwJ_vdpqHvSZzyW7Vei4mCtr2vE1k2qBvG_Qjw2ebLfEdX58k6-eYa7phle9hYjA_q-I8Y-S1ulBiVf_tpvayk8-4lWup9Wbg_BT2vDJOidQgM4l9jV9QHg'; |
||
23 | const DYN_HMAC_TOKEN = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImtleVRocmVlIn0.eyJwcm4iOiJqb2UiLCJpc3MiOiJodHRwOi8vYXBpLnNlcnZlcjIuY29tL29hdXRoMi90b2tlbiJ9.fv9yrTk3AnPTle_ikBY2EjIFhb1xaxKO4-Vop2AxnME'; |
||
24 | // @codingStandardsIgnoreEnd |
||
25 | |||
26 | /** |
||
27 | * @test |
||
28 | */ |
||
29 | public function canGetUnsecuredContentWithoutToken() |
||
36 | |||
37 | /** |
||
38 | * @test |
||
39 | * @expectedException \Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException |
||
40 | */ |
||
41 | public function cannotGetSecuredContentWithoutToken() |
||
45 | |||
46 | /** |
||
47 | * @test |
||
48 | * @expectedException \Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException |
||
49 | */ |
||
50 | public function cannotGetSecuredContentWitInvalidToken() |
||
54 | |||
55 | /** |
||
56 | * @test |
||
57 | */ |
||
58 | public function canGetSecuredContentWitValidPskToken() |
||
65 | |||
66 | /** |
||
67 | * @test |
||
68 | */ |
||
69 | public function canGetSecuredContentWitValidHmacToken() |
||
76 | |||
77 | /** |
||
78 | * @test |
||
79 | */ |
||
80 | public function canGetSecuredContentWithSecretLoader() |
||
87 | |||
88 | /** |
||
89 | * @param string $url |
||
90 | * @param string $token |
||
91 | * |
||
92 | * @return string |
||
93 | */ |
||
94 | private function makeRequest($url, $token = null) |
||
105 | } |
||
106 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: