eZ\Publish\Core\MVC\Symfony\Event\InteractiveLoginEvent::hasAPIUser PHP Method

hasAPIUser() public method

Checks if an API user has been provided.
public hasAPIUser ( ) : boolean
return boolean
    public function hasAPIUser()
    {
        return isset($this->apiUser);
    }

Usage Example

 public function testGetSetAPIUser()
 {
     $event = new InteractiveLoginEvent(new Request(), $this->getMock('Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface'));
     $this->assertFalse($event->hasAPIUser());
     $apiUser = $this->getMock('eZ\\Publish\\API\\Repository\\Values\\User\\User');
     $event->setApiUser($apiUser);
     $this->assertTrue($event->hasAPIUser());
     $this->assertSame($apiUser, $event->getAPIUser());
 }