1 | <?php |
||
22 | abstract class AuthenticatedTestCase extends DatabaseTestCase |
||
23 | { |
||
24 | //<editor-fold desc="Fields"> |
||
25 | /** |
||
26 | * Authentication token if logged in |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $token; |
||
30 | |||
31 | /** |
||
32 | * User corresponding to authentication token if logged in |
||
33 | * @var UserInterface |
||
34 | */ |
||
35 | protected $user; |
||
36 | //</editor-fold desc="Fields"> |
||
37 | |||
38 | //<editor-fold desc="Protected Methods"> |
||
39 | /** |
||
40 | * sends a json request with an authentication token |
||
41 | * @param string $method the method to use (GET, POST, ...) |
||
42 | * @param string $uri the uri of the request |
||
43 | * @param array $data the post data |
||
44 | * @param array $headers the request headers |
||
45 | * @return $this |
||
46 | */ |
||
47 | protected function jsonAuth(string $method, string $uri, array $data = [], array $headers = []) |
||
52 | |||
53 | protected function workOnDatabaseDestroy() |
||
58 | |||
59 | protected function getUserDb() |
||
63 | |||
64 | protected function workOnDatabaseSetUp() |
||
76 | //</editor-fold desc="Protected Methods"> |
||
77 | |||
78 | //<editor-fold desc="Private Methods"> |
||
79 | private function clearUsers() |
||
88 | //</editor-fold desc="Private Methods"> |
||
89 | } |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.