Browse Source

ZF-1721
- Added failing test case for assertion when inheritence is used with assertions (without custom objects)

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@17316 44c647ce-9c0f-0410-b52a-842ac1e357ba

ralph 16 years ago
parent
commit
8fa93ca16f
1 changed files with 22 additions and 0 deletions
  1. 22 0
      tests/Zend/Acl/AclTest.php

+ 22 - 0
tests/Zend/Acl/AclTest.php

@@ -1094,6 +1094,28 @@ class Zend_Acl_AclTest extends PHPUnit_Framework_TestCase
         }
     }
     
+    
+    /**
+     * @group ZF-1721
+     */
+    public function testAclAssertionsGetProperRoleWhenInheritenceIsUsed()
+    {
+        $acl = $this->_loadUseCase1();
+        
+        $user = new Zend_Acl_Role('publisher');
+        $blogPost = new Zend_Acl_Resource('blogPost');
+        
+        /**
+         * @var Zend_Acl_UseCase1_UserIsBlogPostOwnerAssertion
+         */
+        $assertion = $acl->customAssertion;
+        
+        $this->assertTrue($acl->isAllowed($user, $blogPost, 'modify'));
+
+        $this->assertEquals('publisher', $assertion->lastAssertRole->getRoleId());
+        
+    }
+    
     /**
      * 
      * @group ZF-1722