1 | <?php |
||
12 | class HashHmacTest extends \PHPUnit_Framework_TestCase |
||
13 | { |
||
14 | /** |
||
15 | * @var \ReflectionClass |
||
16 | */ |
||
17 | public $reflector; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | public $algo; |
||
23 | |||
24 | /** |
||
25 | * @var array |
||
26 | */ |
||
27 | public $data; |
||
28 | |||
29 | /** |
||
30 | * @var HashHmac |
||
31 | */ |
||
32 | public $hmac; |
||
33 | |||
34 | /** |
||
35 | * |
||
36 | */ |
||
37 | protected function setUp() |
||
45 | |||
46 | /** |
||
47 | * |
||
48 | */ |
||
49 | public function testHash() |
||
58 | |||
59 | /** |
||
60 | * |
||
61 | */ |
||
62 | public function testCompareHash() |
||
67 | |||
68 | /** |
||
69 | * |
||
70 | */ |
||
71 | public function testCompareHashInvalidAlgo() |
||
78 | |||
79 | /** |
||
80 | * |
||
81 | */ |
||
82 | public function testCompareHashNonMatch() |
||
90 | |||
91 | /** |
||
92 | * |
||
93 | */ |
||
94 | public function testVerify() |
||
101 | |||
102 | /** |
||
103 | * |
||
104 | */ |
||
105 | public function testVerifyHashWrongKey() |
||
116 | |||
117 | /** |
||
118 | * |
||
119 | */ |
||
120 | public function testVerifyHashPayloadMismatch() |
||
127 | |||
128 | /** |
||
129 | * |
||
130 | */ |
||
131 | public function testGetPrivateKey() |
||
137 | |||
138 | /** |
||
139 | * |
||
140 | */ |
||
141 | public function testWithPrivateKey() |
||
147 | |||
148 | /** |
||
149 | * |
||
150 | */ |
||
151 | public function testGetAlgorithm() |
||
157 | |||
158 | /** |
||
159 | * |
||
160 | */ |
||
161 | public function testVerifyAlgorithm() |
||
168 | |||
169 | /** |
||
170 | * |
||
171 | */ |
||
172 | public function testVerifyAlgorithmException() |
||
180 | |||
181 | } |
||
182 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: