1 | <?php |
||
29 | class AuthenticateTest extends UnitTestCase |
||
30 | { |
||
31 | //tests also private method disable this tests as soon as all are used in public interfaces |
||
32 | //<editor-fold desc="Public Methods"> |
||
33 | |||
34 | /** |
||
35 | * @covers \Tfboe\FmLib\Http\Middleware\Authenticate::__construct |
||
36 | * @throws ReflectionException |
||
37 | */ |
||
38 | public function testConstruct() |
||
43 | |||
44 | /** |
||
45 | * @covers \Tfboe\FmLib\Http\Middleware\Authenticate::handle |
||
46 | * @throws AuthenticationException |
||
47 | * @throws ReflectionException |
||
48 | * @uses \Tfboe\FmLib\Exceptions\AuthenticationException::__construct |
||
49 | * @uses \Tfboe\FmLib\Http\Middleware\Authenticate::__construct |
||
50 | */ |
||
51 | public function testHandleGuest() |
||
61 | |||
62 | /** |
||
63 | * @covers \Tfboe\FmLib\Http\Middleware\Authenticate::handle |
||
64 | * @throws AuthenticationException |
||
65 | * @throws ReflectionException |
||
66 | * @uses \Tfboe\FmLib\Exceptions\AuthenticationException::__construct |
||
67 | * @uses \Tfboe\FmLib\Http\Middleware\Authenticate::__construct |
||
68 | */ |
||
69 | public function testHandleNoVer() |
||
79 | |||
80 | /** |
||
81 | * @covers \Tfboe\FmLib\Http\Middleware\Authenticate::handle |
||
82 | * @throws AuthenticationException |
||
83 | * @throws ReflectionException |
||
84 | * @uses \Tfboe\FmLib\Exceptions\AuthenticationException::__construct |
||
85 | * @uses \Tfboe\FmLib\Http\Middleware\Authenticate::__construct |
||
86 | */ |
||
87 | public function testHandleOldVersion() |
||
97 | |||
98 | /** |
||
99 | * @covers \Tfboe\FmLib\Http\Middleware\Authenticate::handle |
||
100 | * @throws AuthenticationException |
||
101 | * @throws ReflectionException |
||
102 | * @uses \Tfboe\FmLib\Http\Middleware\Authenticate::__construct |
||
103 | */ |
||
104 | public function testHandleSuccess() |
||
122 | |||
123 | /** |
||
124 | * @covers \Tfboe\FmLib\Http\Middleware\Authenticate::handle |
||
125 | * @throws AuthenticationException |
||
126 | * @throws ReflectionException |
||
127 | * @uses \Tfboe\FmLib\Exceptions\AuthenticationException::__construct |
||
128 | * @uses \Tfboe\FmLib\Http\Middleware\Authenticate::__construct |
||
129 | */ |
||
130 | public function testHandleWrongUser() |
||
140 | //</editor-fold desc="Public Methods"> |
||
141 | |||
142 | //<editor-fold desc="Private Methods"> |
||
143 | /** |
||
144 | * @param Factory|null $auth |
||
145 | * @param array $stubbedMethods |
||
146 | * @return Authenticate|MockObject |
||
147 | * @throws ReflectionException |
||
148 | */ |
||
149 | private function authenticate(?Factory $auth = null, |
||
158 | |||
159 | /** |
||
160 | * @param bool $guest |
||
161 | * @param bool $hasVer |
||
162 | * @param string $userClass |
||
163 | * @param int $userConfirmedVersion |
||
164 | * @return MockObject|Factory |
||
165 | */ |
||
166 | private function getAuth(bool $guest, bool $hasVer, string $userClass, int $userConfirmedVersion): MockObject |
||
189 | //</editor-fold desc="Private Methods"> |
||
190 | } |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.