@@ 175-184 (lines=10) @@ | ||
172 | $this->assertEquals(['forward' => false, 'error' => false], $this->api->pageGatekeeper($role, 'foo/baz')); |
|
173 | } |
|
174 | ||
175 | public function testDenyHook() { |
|
176 | ||
177 | elgg_register_plugin_hook_handler('foo', 'bar', '\Elgg\Values::getTrue'); |
|
178 | $role = $this->api->getRoleByName('deny'); |
|
179 | $this->api->setupHooks($role); |
|
180 | ||
181 | $expected = false; |
|
182 | $actual = elgg_trigger_plugin_hook('foo', 'bar', null, $expected); |
|
183 | $this->assertEquals($expected, $actual); |
|
184 | } |
|
185 | ||
186 | public function testAllowHook() { |
|
187 | ||
@@ 186-195 (lines=10) @@ | ||
183 | $this->assertEquals($expected, $actual); |
|
184 | } |
|
185 | ||
186 | public function testAllowHook() { |
|
187 | ||
188 | elgg_register_plugin_hook_handler('foo', 'bar', '\Elgg\Values::getTrue'); |
|
189 | $role = $this->api->getRoleByName('allow'); |
|
190 | $this->api->setupHooks($role); |
|
191 | ||
192 | $expected = true; |
|
193 | $actual = elgg_trigger_plugin_hook('foo', 'bar', null, null); |
|
194 | $this->assertEquals($expected, $actual); |
|
195 | } |
|
196 | ||
197 | public function testExtendHook() { |
|
198 | ||
@@ 197-206 (lines=10) @@ | ||
194 | $this->assertEquals($expected, $actual); |
|
195 | } |
|
196 | ||
197 | public function testExtendHook() { |
|
198 | ||
199 | elgg_register_plugin_hook_handler('foo', 'bar', '\Elgg\Values::getTrue'); |
|
200 | $role = $this->api->getRoleByName('extend'); |
|
201 | $this->api->setupHooks($role); |
|
202 | ||
203 | $expected = false; |
|
204 | $actual = elgg_trigger_plugin_hook('foo', 'bar', null, null); |
|
205 | $this->assertEquals($expected, $actual); |
|
206 | } |
|
207 | ||
208 | public function testReplaceHook() { |
|
209 | ||
@@ 208-217 (lines=10) @@ | ||
205 | $this->assertEquals($expected, $actual); |
|
206 | } |
|
207 | ||
208 | public function testReplaceHook() { |
|
209 | ||
210 | elgg_register_plugin_hook_handler('foo', 'bar', '\Elgg\Values::getTrue'); |
|
211 | $role = $this->api->getRoleByName('replace'); |
|
212 | $this->api->setupHooks($role); |
|
213 | ||
214 | $expected = false; |
|
215 | $actual = elgg_trigger_plugin_hook('foo', 'bar', null, null); |
|
216 | $this->assertEquals($expected, $actual); |
|
217 | } |
|
218 | ||
219 | public function testDenyEvent() { |
|
220 |