gatekeeper() публичный Метод

См. также: action_gatekeeper
public gatekeeper ( $action ) : boolean
Результат boolean
Пример #1
0
 public function testActionGatekeeper()
 {
     $dt = new \DateTime();
     $this->actions->setCurrentTime($dt);
     ob_start();
     $result = $this->actions->gatekeeper('test');
     ob_end_clean();
     $this->assertFalse($result);
     $this->assertInstanceOf(RedirectResponse::class, _elgg_services()->responseFactory->getSentResponse());
     $ts = $dt->getTimestamp();
     set_input('__elgg_ts', $ts);
     set_input('__elgg_token', $this->actions->generateActionToken($ts));
     $this->assertTrue($this->actions->gatekeeper('test'));
 }