Gc\Mvc\Controller\ActionTest::testOnDispatchWithIdentity PHP Method

testOnDispatchWithIdentity() public method

Test
public testOnDispatchWithIdentity ( ) : void
return void
    public function testOnDispatchWithIdentity()
    {
        $userModel = UserModel::fromArray(array('lastname' => 'Test', 'firstname' => 'Test', 'email' => '[email protected]', 'login' => 'login-test', 'user_acl_role_id' => 2, 'active' => true));
        $userModel->setPassword('password-test');
        $userModel->save();
        $userModel->authenticate('login-test', 'password-test');
        $routeMatch = new RouteMatch(array());
        $routeMatch->setMatchedRouteName('cms');
        $this->object->getEvent()->setRouteMatch($routeMatch);
        $this->object->setAcl(array('resource' => 'development', 'permission' => 'view'));
        $this->assertInstanceOf('Zend\\Http\\PhpEnvironment\\Response', $this->object->dispatch(Registry::get('Application')->getRequest(), null));
        $this->object->setAcl(array('resource' => 'modules', 'permission' => 'view'));
        $this->assertInstanceOf('Zend\\Http\\PhpEnvironment\\Response', $this->object->dispatch(Registry::get('Application')->getRequest(), null));
        $userModel->delete();
    }