Skip to content

Loading…

hasAcl dosn't cheks $defaultAcl Member Variable #3507

Closed
zf2timo opened this Issue · 0 comments

2 participants

@zf2timo

The function hasAcl in NavigationHelper dosn't check the defaultACL member variable. In my opinion its a bug, because if you call the ''getACL'' method, it returns the default ACL.
So i worte a Unit Test that fails:

    public function testHasACLChecksDefaultACL()
    {
        $aclContainer = $this->_getAcl();
        /** @var $acl \Zend\Permissions\Acl\Acl */
        $acl = $aclContainer['acl'];

        $this->assertEquals(false, $this->_helper->hasACL());
        $this->_helper->setDefaultAcl($acl);
        $this->assertEquals(true, $this->_helper->hasAcl());
    }

And in my fork, you can see the changed method https://github.com/zf2timo/zf2/blob/master/library/Zend/View/Helper/Navigation/AbstractHelper.php#L568

@ghost Unknown pushed a commit that referenced this issue
@weierophinney weierophinney Merge branch 'hotfix/3530'
Close #3530
Fixes #3507
8dfa47c
@weierophinney weierophinney added a commit to zendframework/zend-view that referenced this issue
@weierophinney weierophinney Merge branch 'hotfix/3530' ef1b3e8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.