text:
Timesharetalk »
Timeshare News »
$200m resort on Palm Jumeirah
Newshound
IFA Hotels & Resorts, a subsidiary of International Financial Advisors (IFA), Kuwait has signed a new deal with Nakheel to buy 150,000 square metres on the crescent at Palm Jumeirah at a cost of $42 million.
This is Nakheel's fifth agreement with IFA which aims to build an additional 1,000-room luxury resort on the Palm at an expected cost of $200 million.
IFA is in the process of selecting an international hotel company to operate the luxury mixed use hotel and resort.
The property will have a beach frontage of 750 m, said officials .
The location of IFA's second resort on the Palm will be adjacent to the recently announced 2,000 room Atlantis, The Palm, a resort and water theme park located at the centre of The Palm Crescent, Jumeirah. This is being built at an estimated cost of $1 billion and featuring a marine habitat, marina, themed water attractions.
Two weeks ago IFA Hotels & Resorts entered into a joint venture with The Palm developers Nakheel, for the development of two niche market shopping complexes - Suq Palm - and freehold residences - The Palm Residence Suq - covering 60,000 square metres on the trunk of The Palm Jumeirah.
The complex will overlook a 1.5 km canal side Corniche to be called 'The Golden Mile,' which will transform it into one of the world's most sought-after Corniche-style shopping destinations.
The joint venture's shopping and residential complex will cost $300 million and will cover 780 luxury apartments as well as 220 boutique shops and restaurants.
International Financial Advisors (IFA) is listed on the Kuwait Stock Exchange with a market capitalisation of $1 billion.
IFA heads a consortium of several leading Kuwaiti and international companies including; Kuwait Real Estate Company (KREC), International Finance Company (IFC) and United Investments Portugal (UIP).
Jassim M Al Bahar, chairman and managing director of IFA, said:
'IFA's new project to build an additional luxury resort represents further implementation of IFA's policy of providing first class multi use resorts.
'With this new resort on the Palm crescent complimenting IFA's other 1.200 room Hotel & Vacation Club resort on the Palm Jumeirah trunk, adjacent to the Souq Palm -- the joint venture between Nakheel and IFA - as well as the 246 luxury shoreline apartments facing Burj Al Arab on the six kilometre trunk.
'This latest addition by IFA will offer tourists, as well as property owners/timeshare owners, a variety of choices on the trunk and on the 11 km Palm Crescent by IFA Hotels & Resorts'.
Nakheel chairman Sultan Ahmed Bin Sulayem welcomed the latest investment by IFA group.
'This latest investment further strengthens the excellent relations that exist between Nakheel and IFA and demonstrates how this relationship has flourished at a rapid pace reflecting the cooperation that exists between our two groups,' said Bin Sulayem.
Jassim M Al Bahar said this latest IFA investment is a further reflection of the group's positive outlook at the pace in which tourism in Dubai is developing.
'Under the guidance of General Shaikh Mohammed bin Rashid Al Maktoum, Crown Prince of Dubai and UAE Defence Minister, Dubai has succeeded as a world class destination for international tourism.
'It is worthy to note that Dubai tourism arrivals are expected to reach 15m by 2010 and 40 million by 2015.
'The figures speak for themselves and IFA is proud to be part of that growth thereby providing its clients with world class networks in the Middle East, Africa and Europe.'
Nakheel's portfolio currently includes The Palm, The World, Jumeirah Islands, The Gardens, The Gardens Shopping Mall, Jumeirah Lake Towers and International City.
© 2004 - 2019 Timesharetalk.co.uk | Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC | Sitemap
Our Service is designed for, and may only be used for, bona fide discussion about the topics which we place for discussion on our Service. Unless otherwise stated on our Service, posts must relate to the types of contracts defined in The Timeshare, Holiday Products, Resale and Exchange Contracts Regulations 2010, Statutory Instrument 2010 No. 2960. Any non-compliant posts / threads will be subject to deletion.


text:
Q: MS Access 2016 - table - lookup values I can do a simple lookup field in a table to choose values from another table field. Suppose my new table has the first field as a lookup field (Surname). It gives you a long dropdown menu of all the surnames available.
Now, how do I limit the dropdown menu in the second field to restrict only to first names available, matching the above selected surname (not all the first names available)
The third field should automatically result in an unique ID (taken from another table that is assigned to this particular combination (Surname + First name) (Assuming there are no multiple people with the same surname + first name)
Thank you

A: What you describe is known as 'cascading' or 'dependent' combobox. This requires code behind a form. This is a common topic How can i filter a combobox selection list based on another combobox selection
Advise never build lookups in table. Build combobox on form. http://access.mvps.org/Access/lookupfields.htm
Should not be saving name parts into another data table, save only EmpID.
Don't separately select surname and firstname. Concatenate name parts to a single value listed in combobox dropdown:
SELECT EmpID, Surname & ", " & Firstname AS Fullname FROM Employees ORDER BY Surname, Firstname;
To handle possibility of multiple people with same name (e.g. John Smith), include another identifying field in the concatenation, such as job title.
Set combobox properties to hide EmpID column and users see the descriptive info column but EmpID is value of combobox.

redpajama_set_name: RedPajamaStackExchange


text:
<?php

require_once 'Zend/Acl.php';
require_once 'Zend/Acl/Resource.php';
require_once 'Zend/Acl/Role.php';
require_once dirname(__FILE__) . '/_files/MockAssertion.php';

/**
 * @category   Zend
 * @package    Zend_Acl
 * @subpackage UnitTests
 * @group      Zend_Acl
 * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Zend_Acl_AclTest extends PHPUnit_Framework_TestCase
{
    /**
     * ACL object for each test method
     *
     * @var Zend_Acl
     */
    protected $_acl;

    /**
     * Instantiates a new ACL object and creates internal reference to it for each test method
     *
     * @return void
     */
    public function setUp()
    {
        $this->_acl = new Zend_Acl();
    }

    /**
     * Ensures that basic addition and retrieval of a single Role works
     *
     * @return void
     */
    public function testRoleRegistryAddAndGetOne()
    {
        $roleGuest = new Zend_Acl_Role('guest');

        $role = $this->_acl->addRole($roleGuest)
                          ->getRole($roleGuest->getRoleId());
        $this->assertTrue($roleGuest === $role);
        $role = $this->_acl->getRole($roleGuest);
        $this->assertTrue($roleGuest === $role);
    }

    /**
     * Ensures that basic addition and retrieval of a single Resource works
     */
    public function testRoleAddAndGetOneByString()
    {
        $role = $this->_acl->addRole('area')
                          ->getRole('area');
        $this->assertTrue($role instanceof Zend_Acl_Role);
        $this->assertEquals('area', $role->getRoleId());
    }

    /**
     * Ensures that basic removal of a single Role works
     *
     * @return void
     */
    public function testRoleRegistryRemoveOne()
    {
        $roleGuest = new Zend_Acl_Role('guest');
        $this->_acl->addRole($roleGuest)
                   ->removeRole($roleGuest);
        $this->assertFalse($this->_acl->hasRole($roleGuest));
    }

    /**
     * Ensures that an exception is thrown when a non-existent Role is specified for removal
     *
     * @return void
     */
    public function testRoleRegistryRemoveOneNonExistent()
    {
        try {
            $this->_acl->removeRole('nonexistent');
            $this->fail('Expected Zend_Acl_Role_Registry_Exception not thrown upon removing a non-existent Role');
        } catch (Zend_Acl_Role_Registry_Exception $e) {
            $this->assertContains('not found', $e->getMessage());
        }
    }

    /**
     * Ensures that removal of all Roles works
     *
     * @return void
     */
    public function testRoleRegistryRemoveAll()
    {
        $roleGuest = new Zend_Acl_Role('guest');
        $this->_acl->addRole($roleGuest)
                   ->removeRoleAll();
        $this->assertFalse($this->_acl->hasRole($roleGuest));
    }

    /**
     * Ensures that an exception is thrown when a non-existent Role is specified as a parent upon Role addition
     *
     * @return void
     */
    public function testRoleRegistryAddInheritsNonExistent()
    {
        try {
            $this->_acl->addRole(new Zend_Acl_Role('guest'), 'nonexistent');
            $this->fail('Expected Zend_Acl_Role_Registry_Exception not thrown upon specifying a non-existent parent');
        } catch (Zend_Acl_Role_Registry_Exception $e) {
            $this->assertContains('does not exist', $e->getMessage());
        }
    }

    /**
     * Ensures that an exception is thrown when a non-existent Role is specified to each parameter of inherits()
     *
     * @return void
     */
    public function testRoleRegistryInheritsNonExistent()
    {
        $roleGuest = new Zend_Acl_Role('guest');
        $this->_acl->addRole($roleGuest);
        try {
            $this->_acl->inheritsRole('nonexistent', $roleGuest);
            $this->fail('Expected Zend_Acl_Role_Registry_Exception not thrown upon specifying a non-existent child Role');
        } catch (Zend_Acl_Role_Registry_Exception $e) {
            $this->assertContains('not found', $e->getMessage());
        }
        try {
            $this->_acl->inheritsRole($roleGuest, 'nonexistent');
            $this->fail('Expected Zend_Acl_Role_Registry_Exception not thrown upon specifying a non-existent parent Role');
        } catch (Zend_Acl_Role_Registry_Exception $e) {
            $this->assertContains('not found', $e->getMessage());
        }
    }

    /**
     * Tests basic Role inheritance
     *
     * @return void
     */
    public function testRoleRegistryInherits()
    {
        $roleGuest  = new Zend_Acl_Role('guest');
        $roleMember = new Zend_Acl_Role('member');
        $roleEditor = new Zend_Acl_Role('editor');
        $roleRegistry = new Zend_Acl_Role_Registry();
        $roleRegistry->add($roleGuest)
                    ->add($roleMember, $roleGuest->getRoleId())
                    ->add($roleEditor, $roleMember);
        $this->assertTrue(0 === count($roleRegistry->getParents($roleGuest)));
        $roleMemberParents = $roleRegistry->getParents($roleMember);
        $this->assertTrue(1 === count($roleMemberParents));
        $this->assertTrue(isset($roleMemberParents['guest']));
        $roleEditorParents = $roleRegistry->getParents($roleEditor);
        $this->assertTrue(1 === count($roleEditorParents));
        $this->assertTrue(isset($roleEditorParents['member']));
        $this->assertTrue($roleRegistry->inherits($roleMember, $roleGuest, true));
        $this->assertTrue($roleRegistry->inherits($roleEditor, $roleMember, true));
        $this->assertTrue($roleRegistry->inherits($roleEditor, $roleGuest));
        $this->assertFalse($roleRegistry->inherits($roleGuest, $roleMember));
        $this->assertFalse($roleRegistry->inherits($roleMember, $roleEditor));
        $this->assertFalse($roleRegistry->inherits($roleGuest, $roleEditor));
        $roleRegistry->remove($roleMember);
        $this->assertTrue(0 === count($roleRegistry->getParents($roleEditor)));
        $this->assertFalse($roleRegistry->inherits($roleEditor, $roleGuest));
    }

    /**
     * Tests basic Role multiple inheritance
     *
     * @return void
     */
    public function testRoleRegistryInheritsMultiple()
    {
        $roleParent1 = new Zend_Acl_Role('parent1');
        $roleParent2 = new Zend_Acl_Role('parent2');
        $roleChild   = new Zend_Acl_Role('child');
        $roleRegistry = new Zend_Acl_Role_Registry();
        $roleRegistry->add($roleParent1)
                    ->add($roleParent2)
                    ->add($roleChild, array($roleParent1, $roleParent2));
        $roleChildParents = $roleRegistry->getParents($roleChild);
        $this->assertTrue(2 === count($roleChildParents));
        $i = 1;
        foreach ($roleChildParents as $roleParentId => $roleParent) {
            $this->assertTrue("parent$i" === $roleParentId);
            $i++;
        }
        $this->assertTrue($roleRegistry->inherits($roleChild, $roleParent1));
        $this->assertTrue($roleRegistry->inherits($roleChild, $roleParent2));
        $roleRegistry->remove($roleParent1);
        $roleChildParents = $roleRegistry->getParents($roleChild);
        $this->assertTrue(1 === count($roleChildParents));
        $this->assertTrue(isset($roleChildParents['parent2']));
        $this->assertTrue($roleRegistry->inherits($roleChild, $roleParent2));
    }

    /**
     * Ensures that the same Role cannot be registered more than once to the registry
     *
     * @return void
     */
    public function testRoleRegistryDuplicate()
    {
        $roleGuest = new Zend_Acl_Role('guest');
        $roleRegistry = new Zend_Acl_Role_Registry();
        try {
            $roleRegistry->add($roleGuest)
                        ->add($roleGuest);
            $this->fail('Expected exception not thrown upon adding same Role twice');
        } catch (Zend_Acl_Role_Registry_Exception $e) {
            $this->assertContains('already exists', $e->getMessage());
        }
    }

    /**
     * Ensures that two Roles having the same ID cannot be registered
     *
     * @return void
     */
    public function testRoleRegistryDuplicateId()
    {
        $roleGuest1 = new Zend_Acl_Role('guest');
        $roleGuest2 = new Zend_Acl_Role('guest');
        $roleRegistry = new Zend_Acl_Role_Registry();
        try {
            $roleRegistry->add($roleGuest1)
                        ->add($roleGuest2);
            $this->fail('Expected exception not thrown upon adding two Roles with same ID');
        } catch (Zend_Acl_Role_Registry_Exception $e) {
            $this->assertContains('already exists', $e->getMessage());
        }
    }

    /**
     * Ensures that basic addition and retrieval of a single Resource works
     *
     * @return void
     */
    public function testResourceAddAndGetOne()
    {
        $resourceArea = new Zend_Acl_Resource('area');
        $resource = $this->_acl->add($resourceArea)
                          ->get($resourceArea->getResourceId());
        $this->assertTrue($resourceArea === $resource);
        $resource = $this->_acl->get($resourceArea);
        $this->assertTrue($resourceArea === $resource);
    }

    /**
     * Ensures that basic addition and retrieval of a single Resource works
     */
    public function testResourceAddAndGetOneByString()
    {
        $resource = $this->_acl->addResource('area')
                          ->get('area');
        $this->assertTrue($resource instanceof Zend_Acl_Resource);
        $this->assertEquals('area', $resource->getResourceId());
    }

    /**
     * Ensures that basic addition and retrieval of a single Resource works
     *
     * @group ZF-1167
     */
    public function testResourceAddAndGetOneWithAddResourceMethod()
    {
        $resourceArea = new Zend_Acl_Resource('area');
        $resource = $this->_acl->addResource($resourceArea)
                          ->get($resourceArea->getResourceId());
        $this->assertTrue($resourceArea === $resource);
        $resource = $this->_acl->get($resourceArea);
        $this->assertTrue($resourceArea === $resource);
    }

    /**
     * Ensures that basic removal of a single Resource works
     *
     * @return void
     */
    public function testResourceRemoveOne()
    {
        $resourceArea = new Zend_Acl_Resource('area');
        $this->_acl->add($resourceArea)
                   ->remove($resourceArea);
        $this->assertFalse($this->_acl->has($resourceArea));
    }

    /**
     * Ensures that an exception is thrown when a non-existent Resource is specified for removal
     *
     * @return void
     */
    public function testResourceRemoveOneNonExistent()
    {
        try {
            $this->_acl->remove('nonexistent');
            $this->fail('Expected Zend_Acl_Exception not thrown upon removing a non-existent Resource');
        } catch (Zend_Acl_Exception $e) {
            $this->assertContains('not found', $e->getMessage());
        }
    }

    /**
     * Ensures that removal of all Resources works
     *
     * @return void
     */
    public function testResourceRemoveAll()
    {
        $resourceArea = new Zend_Acl_Resource('area');
        $this->_acl->add($resourceArea)
                   ->removeAll();
        $this->assertFalse($this->_acl->has($resourceArea));
    }

    /**
     * Ensures that an exception is thrown when a non-existent Resource is specified as a parent upon Resource addition
     *
     * @return void
     */
    public function testResourceAddInheritsNonExistent()
    {
        try {
            $this->_acl->add(new Zend_Acl_Resource('area'), 'nonexistent');
            $this->fail('Expected Zend_Acl_Exception not thrown upon specifying a non-existent parent');
        } catch (Zend_Acl_Exception $e) {
            $this->assertContains('does not exist', $e->getMessage());
        }
    }

    /**
     * Ensures that an exception is thrown when a non-existent Resource is specified to each parameter of inherits()
     *
     * @return void
     */
    public function testResourceInheritsNonExistent()
    {
        $resourceArea = new Zend_Acl_Resource('area');
        $this->_acl->add($resourceArea);
        try {
            $this->_acl->inherits('nonexistent', $resourceArea);
            $this->fail('Expected Zend_Acl_Exception not thrown upon specifying a non-existent child Resource');
        } catch (Zend_Acl_Exception $e) {
            $this->assertContains('not found', $e->getMessage());
        }
        try {
            $this->_acl->inherits($resourceArea, 'nonexistent');
            $this->fail('Expected Zend_Acl_Exception not thrown upon specifying a non-existent parent Resource');
        } catch (Zend_Acl_Exception $e) {
            $this->assertContains('not found', $e->getMessage());
        }
    }

    /**
     * Tests basic Resource inheritance
     *
     * @return void
     */
    public function testResourceInherits()
    {
        $resourceCity     = new Zend_Acl_Resource('city');
        $resourceBuilding = new Zend_Acl_Resource('building');
        $resourceRoom     = new Zend_Acl_Resource('room');
        $this->_acl->add($resourceCity)
                   ->add($resourceBuilding, $resourceCity->getResourceId())
                   ->add($resourceRoom, $resourceBuilding);
        $this->assertTrue($this->_acl->inherits($resourceBuilding, $resourceCity, true));
        $this->assertTrue($this->_acl->inherits($resourceRoom, $resourceBuilding, true));
        $this->assertTrue($this->_acl->inherits($resourceRoom, $resourceCity));
        $this->assertFalse($this->_acl->inherits($resourceCity, $resourceBuilding));
        $this->assertFalse($this->_acl->inherits($resourceBuilding, $resourceRoom));
        $this->assertFalse($this->_acl->inherits($resourceCity, $resourceRoom));
        $this->_acl->remove($resourceBuilding);
        $this->assertFalse($this->_acl->has($resourceRoom));
    }

    /**
     * Ensures that the same Resource cannot be added more than once
     *
     * @return void
     */
    public function testResourceDuplicate()
    {
        try {
            $resourceArea = new Zend_Acl_Resource('area');
            $this->_acl->add($resourceArea)
                       ->add($resourceArea);
            $this->fail('Expected exception not thrown upon adding same Resource twice');
        } catch (Zend_Acl_Exception $e) {
            $this->assertContains('already exists', $e->getMessage());
        }
    }

    /**
     * Ensures that two Resources having the same ID cannot be added
     *
     * @return void
     */
    public function testResourceDuplicateId()
    {
        try {
            $resourceArea1 = new Zend_Acl_Resource('area');
            $resourceArea2 = new Zend_Acl_Resource('area');
            $this->_acl->add($resourceArea1)
                       ->add($resourceArea2);
            $this->fail('Expected exception not thrown upon adding two Resources with same ID');
        } catch (Zend_Acl_Exception $e) {
            $this->assertContains('already exists', $e->getMessage());
        }
    }

    /**
     * Ensures that an exception is thrown when a non-existent Role and Resource parameters are specified to isAllowed()
     *
     * @return void
     */
    public function testIsAllowedNonExistent()
    {
        try {
            $this->_acl->isAllowed('nonexistent');
            $this->fail('Expected Zend_Acl_Role_Registry_Exception not thrown upon non-existent Role');
        } catch (Zend_Acl_Role_Registry_Exception $e) {
            $this->assertContains('not found', $e->getMessage());
        }
        try {
            $this->_acl->isAllowed(null, 'nonexistent');
            $this->fail('Expected Zend_Acl_Exception not thrown upon non-existent Resource');
        } catch (Zend_Acl_Exception $e) {
            $this->assertContains('not found', $e->getMessage());
        }
    }

    /**
     * Ensures that by default, Zend_Acl denies access to everything by all
     *
     * @return void
     */
    public function testDefaultDeny()
    {
        $this->assertFalse($this->_acl->isAllowed());
    }

    /**
     * Ensures that the default rule obeys its assertion
     *
     * @return void
     */
    public function testDefaultAssert()
    {
        $this->_acl->deny(null, null, null, new Zend_Acl_MockAssertion(false));
        $this->assertTrue($this->_acl->isAllowed());
        $this->assertTrue($this->_acl->isAllowed(null, null, 'somePrivilege'));
    }

    /**
     * Ensures that ACL-wide rules (all Roles, Resources, and privileges) work properly
     *
     * @return void
     */
    public function testDefaultRuleSet()
    {
        $this->_acl->allow();
        $this->assertTrue($this->_acl->isAllowed());
        $this->_acl->deny();
        $this->assertFalse($this->_acl->isAllowed());
    }

    /**
     * Ensures that by default, Zend_Acl denies access to a privilege on anything by all
     *
     * @return void
     */
    public function testDefaultPrivilegeDeny()
    {
        $this->assertFalse($this->_acl->isAllowed(null, null, 'somePrivilege'));
    }

    /**
     * Ensures that ACL-wide rules apply to privileges
     *
     * @return void
     */
    public function testDefaultRuleSetPrivilege()
    {
        $this->_acl->allow();
        $this->assertTrue($this->_acl->isAllowed(null, null, 'somePrivilege'));
        $this->_acl->deny();
        $this->assertFalse($this->_acl->isAllowed(null, null, 'somePrivilege'));
    }

    /**
     * Ensures that a privilege allowed for all Roles upon all Resources works properly
     *
     * @return void
     */
    public function testPrivilegeAllow()
    {
        $this->_acl->allow(null, null, 'somePrivilege');
        $this->assertTrue($this->_acl->isAllowed(null, null, 'somePrivilege'));
    }

    /**
     * Ensures that a privilege denied for all Roles upon all Resources works properly
     *
     * @return void
     */
    public function testPrivilegeDeny()
    {
        $this->_acl->allow();
        $this->_acl->deny(null, null, 'somePrivilege');
        $this->assertFalse($this->_acl->isAllowed(null, null, 'somePrivilege'));
    }

    /**
     * Ensures that multiple privileges work properly
     *
     * @return void
     */
    public function testPrivileges()
    {
        $this->_acl->allow(null, null, array('p1', 'p2', 'p3'));
        $this->assertTrue($this->_acl->isAllowed(null, null, 'p1'));
        $this->assertTrue($this->_acl->isAllowed(null, null, 'p2'));
        $this->assertTrue($this->_acl->isAllowed(null, null, 'p3'));
        $this->assertFalse($this->_acl->isAllowed(null, null, 'p4'));
        $this->_acl->deny(null, null, 'p1');
        $this->assertFalse($this->_acl->isAllowed(null, null, 'p1'));
        $this->_acl->deny(null, null, array('p2', 'p3'));
        $this->assertFalse($this->_acl->isAllowed(null, null, 'p2'));
        $this->assertFalse($this->_acl->isAllowed(null, null, 'p3'));
    }

    /**
     * Ensures that assertions on privileges work properly
     *
     * @return void
     */
    public function testPrivilegeAssert()
    {
        $this->_acl->allow(null, null, 'somePrivilege', new Zend_Acl_MockAssertion(true));
        $this->assertTrue($this->_acl->isAllowed(null, null, 'somePrivilege'));
        $this->_acl->allow(null, null, 'somePrivilege', new Zend_Acl_MockAssertion(false));
        $this->assertFalse($this->_acl->isAllowed(null, null, 'somePrivilege'));
    }

    /**
     * Ensures that by default, Zend_Acl denies access to everything for a particular Role
     *
     * @return void
     */
    public function testRoleDefaultDeny()
    {
        $roleGuest = new Zend_Acl_Role('guest');
        $this->_acl->addRole($roleGuest);
        $this->assertFalse($this->_acl->isAllowed($roleGuest));
    }

    /**
     * Ensures that ACL-wide rules (all Resources and privileges) work properly for a particular Role
     *
     * @return void
     */
    public function testRoleDefaultRuleSet()
    {
        $roleGuest = new Zend_Acl_Role('guest');
        $this->_acl->addRole($roleGuest)
                   ->allow($roleGuest);
        $this->assertTrue($this->_acl->isAllowed($roleGuest));
        $this->_acl->deny($roleGuest);
        $this->assertFalse($this->_acl->isAllowed($roleGuest));
    }

    /**
     * Ensures that by default, Zend_Acl denies access to a privilege on anything for a particular Role
     *
     * @return void
     */
    public function testRoleDefaultPrivilegeDeny()
    {
        $roleGuest = new Zend_Acl_Role('guest');
        $this->_acl->addRole($roleGuest);
        $this->assertFalse($this->_acl->isAllowed($roleGuest, null, 'somePrivilege'));
    }

    /**
     * Ensures that ACL-wide rules apply to privileges for a particular Role
     *
     * @return void
     */
    public function testRoleDefaultRuleSetPrivilege()
    {
        $roleGuest = new Zend_Acl_Role('guest');
        $this->_acl->addRole($roleGuest)
                   ->allow($roleGuest);
        $this->assertTrue($this->_acl->isAllowed($roleGuest, null, 'somePrivilege'));
        $this->_acl->deny($roleGuest);
        $this->assertFalse($this->_acl->isAllowed($roleGuest, null, 'somePrivilege'));
    }

    /**
     * Ensures that a privilege allowed for a particular Role upon all Resources works properly
     *
     * @return void
     */
    public function testRolePrivilegeAllow()
    {
        $roleGuest = new Zend_Acl_Role('guest');
        $this->_acl->addRole($roleGuest)
                   ->allow($roleGuest, null, 'somePrivilege');
        $this->assertTrue($this->_acl->isAllowed($roleGuest, null, 'somePrivilege'));
    }

    /**
     * Ensures that a privilege denied for a particular Role upon all Resources works properly
     *
     * @return void
     */
    public function testRolePrivilegeDeny()
    {
        $roleGuest = new Zend_Acl_Role('guest');
        $this->_acl->addRole($roleGuest)
                   ->allow($roleGuest)
                   ->deny($roleGuest, null, 'somePrivilege');
        $this->assertFalse($this->_acl->isAllowed($roleGuest, null, 'somePrivilege'));
    }

    /**
     * Ensures that multiple privileges work properly for a particular Role
     *
     * @return void
     */
    public function testRolePrivileges()
    {
        $roleGuest = new Zend_Acl_Role('guest');
        $this->_acl->addRole($roleGuest)
                   ->allow($roleGuest, null, array('p1', 'p2', 'p3'));
        $this->assertTrue($this->_acl->isAllowed($roleGuest, null, 'p1'));
        $this->assertTrue($this->_acl->isAllowed($roleGuest, null, 'p2'));
        $this->assertTrue($this->_acl->isAllowed($roleGuest, null, 'p3'));
        $this->assertFalse($this->_acl->isAllowed($roleGuest, null, 'p4'));
        $this->_acl->deny($roleGuest, null, 'p1');
        $this->assertFalse($this->_acl->isAllowed($roleGuest, null, 'p1'));
        $this->_acl->deny($roleGuest, null, array('p2', 'p3'));
        $this->assertFalse($this->_acl->isAllowed($roleGuest, null, 'p2'));
        $this->assertFalse($this->_acl->isAllowed($roleGuest, null, 'p3'));
    }

    /**
     * Ensures that assertions on privileges work properly for a particular Role
     *
     * @return void
     */
    public function testRolePrivilegeAssert()
    {
        $roleGuest = new Zend_Acl_Role('guest');
        $this->_acl->addRole($roleGuest)
                   ->allow($roleGuest, null, 'somePrivilege', new Zend_Acl_MockAssertion(true));
        $this->assertTrue($this->_acl->isAllowed($roleGuest, null, 'somePrivilege'));
        $this->_acl->allow($roleGuest, null, 'somePrivilege', new Zend_Acl_MockAssertion(false));
        $this->assertFalse($this->_acl->isAllowed($roleGuest, null, 'somePrivilege'));
    }

    /**
     * Ensures that removing the default deny rule results in default deny rule
     *
     * @return void
     */
    public function testRemoveDefaultDeny()
    {
        $this->assertFalse($this->_acl->isAllowed());
        $this->_acl->removeDeny();
        $this->assertFalse($this->_acl->isAllowed());
    }

    /**
     * Ensures that removing the default deny rule results in assertion method being removed
     *
     * @return void
     */
    public function testRemoveDefaultDenyAssert()
    {
        $this->_acl->deny(null, null, null, new Zend_Acl_MockAssertion(false));
        $this->assertTrue($this->_acl->isAllowed());
        $this->_acl->removeDeny();
        $this->assertFalse($this->_acl->isAllowed());
    }

    /**
     * Ensures that removing the default allow rule results in default deny rule being assigned
     *
     * @return void
     */
    public function testRemoveDefaultAllow()
    {
        $this->_acl->allow();
        $this->assertTrue($this->_acl->isAllowed());
        $this->_acl->removeAllow();
        $this->assertFalse($this->_acl->isAllowed());
    }

    /**
     * Ensures that removing non-existent default allow rule does nothing
     *
     * @return void
     */
    public function testRemoveDefaultAllowNonExistent()
    {
        $this->_acl->removeAllow();
        $this->assertFalse($this->_acl->isAllowed());
    }

    /**
     * Ensures that removing non-existent default deny rule does nothing
     *
     * @return void
     */
    public function testRemoveDefaultDenyNonExistent()
    {
        $this->_acl->allow()
                   ->removeDeny();
        $this->assertTrue($this->_acl->isAllowed());
    }

    /**
     * Ensures that for a particular Role, a deny rule on a specific Resource is honored before an allow rule
     * on the entire ACL
     *
     * @return void
     */
    public function testRoleDefaultAllowRuleWithResourceDenyRule()
    {
        $this->_acl->addRole(new Zend_Acl_Role('guest'))
                   ->addRole(new Zend_Acl_Role('staff'), 'guest')
                   ->add(new Zend_Acl_Resource('area1'))
                   ->add(new Zend_Acl_Resource('area2'))
                   ->deny()
                   ->allow('staff')
                   ->deny('staff', array('area1', 'area2'));
        $this->assertFalse($this->_acl->isAllowed('staff', 'area1'));
    }

    /**
     * Ensures that for a particular Role, a deny rule on a specific privilege is honored before an allow
     * rule on the entire ACL
     *
     * @return void
     */
    public function testRoleDefaultAllowRuleWithPrivilegeDenyRule()
    {
        $this->_acl->addRole(new Zend_Acl_Role('guest'))
                   ->addRole(new Zend_Acl_Role('staff'), 'guest')
                   ->deny()
                   ->allow('staff')
                   ->deny('staff', null, array('privilege1', 'privilege2'));
        $this->assertFalse($this->_acl->isAllowed('staff', null, 'privilege1'));
    }

    /**
     * Ensure that basic rule removal works
     *
     * @return void
     */
    public function testRulesRemove()
    {
        $this->_acl->allow(null, null, array('privilege1', 'privilege2'));
        $this->assertFalse($this->_acl->isAllowed());
        $this->assertTrue($this->_acl->isAllowed(null, null, 'privilege1'));
        $this->assertTrue($this->_acl->isAllowed(null, null, 'privilege2'));
        $this->_acl->removeAllow(null, null, 'privilege1');
        $this->assertFalse($this->_acl->isAllowed(null, null, 'privilege1'));
        $this->assertTrue($this->_acl->isAllowed(null, null, 'privilege2'));
    }

    /**
     * Ensures that removal of a Role results in its rules being removed
     *
     * @return void
     */
    public function testRuleRoleRemove()
    {
        $this->_acl->addRole(new Zend_Acl_Role('guest'))
                   ->allow('guest');
        $this->assertTrue($this->_acl->isAllowed('guest'));
        $this->_acl->removeRole('guest');
        try {
            $this->_acl->isAllowed('guest');
            $this->fail('Expected Zend_Acl_Role_Registry_Exception not thrown upon isAllowed() on non-existent Role');
        } catch (Zend_Acl_Role_Registry_Exception $e) {
            $this->assertContains('not found', $e->getMessage());
        }
        $this->_acl->addRole(new Zend_Acl_Role('guest'));
        $this->assertFalse($this->_acl->isAllowed('guest'));
    }

    /**
     * Ensures that removal of all Roles results in Role-specific rules being removed
     *
     * @return void
     */
    public function testRuleRoleRemoveAll()
    {
        $this->_acl->addRole(new Zend_Acl_Role('guest'))
                   ->allow('guest');
        $this->assertTrue($this->_acl->isAllowed('guest'));
        $this->_acl->removeRoleAll();
        try {
            $this->_acl->isAllowed('guest');
            $this->fail('Expected Zend_Acl_Role_Registry_Exception not thrown upon isAllowed() on non-existent Role');
        } catch (Zend_Acl_Role_Registry_Exception $e) {
            $this->assertContains('not found', $e->getMessage());
        }
        $this->_acl->addRole(new Zend_Acl_Role('guest'));
        $this->assertFalse($this->_acl->isAllowed('guest'));
    }

    /**
     * Ensures that removal of a Resource results in its rules being removed
     *
     * @return void
     */
    public function testRulesResourceRemove()
    {
        $this->_acl->add(new Zend_Acl_Resource('area'))
                   ->allow(null, 'area');
        $this->assertTrue($this->_acl->isAllowed(null, 'area'));
        $this->_acl->remove('area');
        try {
            $this->_acl->isAllowed(null, 'area');
            $this->fail('Expected Zend_Acl_Exception not thrown upon isAllowed() on non-existent Resource');
        } catch (Zend_Acl_Exception $e) {
            $this->assertContains('not found', $e->getMessage());
        }
        $this->_acl->add(new Zend_Acl_Resource('area'));
        $this->assertFalse($this->_acl->isAllowed(null, 'area'));
    }

    /**
     * Ensures that removal of all Resources results in Resource-specific rules being removed
     *
     * @return void
     */
    public function testRulesResourceRemoveAll()
    {
        $this->_acl->add(new Zend_Acl_Resource('area'))
                   ->allow(null, 'area');
        $this->assertTrue($this->_acl->isAllowed(null, 'area'));
        $this->_acl->removeAll();
        try {
            $this->_acl->isAllowed(null, 'area');
            $this->fail('Expected Zend_Acl_Exception not thrown upon isAllowed() on non-existent Resource');
        } catch (Zend_Acl_Exception $e) {
            $this->assertContains('not found', $e->getMessage());
        }
        $this->_acl->add(new Zend_Acl_Resource('area'));
        $this->assertFalse($this->_acl->isAllowed(null, 'area'));
    }

    /**
     * Ensures that an example for a content management system is operable
     *
     * @return void
     */
    public function testCMSExample()
    {
        // Add some roles to the Role registry
        $this->_acl->addRole(new Zend_Acl_Role('guest'))
                   ->addRole(new Zend_Acl_Role('staff'), 'guest')  // staff inherits permissions from guest
                   ->addRole(new Zend_Acl_Role('editor'), 'staff') // editor inherits permissions from staff
                   ->addRole(new Zend_Acl_Role('administrator'));

        // Guest may only view content
        $this->_acl->allow('guest', null, 'view');

        // Staff inherits view privilege from guest, but also needs additional privileges
        $this->_acl->allow('staff', null, array('edit', 'submit', 'revise'));

        // Editor inherits view, edit, submit, and revise privileges, but also needs additional privileges
        $this->_acl->allow('editor', null, array('publish', 'archive', 'delete'));

        // Administrator inherits nothing but is allowed all privileges
        $this->_acl->allow('administrator');

        // Access control checks based on above permission sets

        $this->assertTrue($this->_acl->isAllowed('guest', null, 'view'));
        $this->assertFalse($this->_acl->isAllowed('guest', null, 'edit'));
        $this->assertFalse($this->_acl->isAllowed('guest', null, 'submit'));
        $this->assertFalse($this->_acl->isAllowed('guest', null, 'revise'));
        $this->assertFalse($this->_acl->isAllowed('guest', null, 'publish'));
        $this->assertFalse($this->_acl->isAllowed('guest', null, 'archive'));
        $this->assertFalse($this->_acl->isAllowed('guest', null, 'delete'));
        $this->assertFalse($this->_acl->isAllowed('guest', null, 'unknown'));
        $this->assertFalse($this->_acl->isAllowed('guest'));

        $this->assertTrue($this->_acl->isAllowed('staff', null, 'view'));
        $this->assertTrue($this->_acl->isAllowed('staff', null, 'edit'));
        $this->assertTrue($this->_acl->isAllowed('staff', null, 'submit'));
        $this->assertTrue($this->_acl->isAllowed('staff', null, 'revise'));
        $this->assertFalse($this->_acl->isAllowed('staff', null, 'publish'));
        $this->assertFalse($this->_acl->isAllowed('staff', null, 'archive'));
        $this->assertFalse($this->_acl->isAllowed('staff', null, 'delete'));
        $this->assertFalse($this->_acl->isAllowed('staff', null, 'unknown'));
        $this->assertFalse($this->_acl->isAllowed('staff'));

        $this->assertTrue($this->_acl->isAllowed('editor', null, 'view'));
        $this->assertTrue($this->_acl->isAllowed('editor', null, 'edit'));
        $this->assertTrue($this->_acl->isAllowed('editor', null, 'submit'));
        $this->assertTrue($this->_acl->isAllowed('editor', null, 'revise'));
        $this->assertTrue($this->_acl->isAllowed('editor', null, 'publish'));
        $this->assertTrue($this->_acl->isAllowed('editor', null, 'archive'));
        $this->assertTrue($this->_acl->isAllowed('editor', null, 'delete'));
        $this->assertFalse($this->_acl->isAllowed('editor', null, 'unknown'));
        $this->assertFalse($this->_acl->isAllowed('editor'));

        $this->assertTrue($this->_acl->isAllowed('administrator', null, 'view'));
        $this->assertTrue($this->_acl->isAllowed('administrator', null, 'edit'));
        $this->assertTrue($this->_acl->isAllowed('administrator', null, 'submit'));
        $this->assertTrue($this->_acl->isAllowed('administrator', null, 'revise'));
        $this->assertTrue($this->_acl->isAllowed('administrator', null, 'publish'));
        $this->assertTrue($this->_acl->isAllowed('administrator', null, 'archive'));
        $this->assertTrue($this->_acl->isAllowed('administrator', null, 'delete'));
        $this->assertTrue($this->_acl->isAllowed('administrator', null, 'unknown'));
        $this->assertTrue($this->_acl->isAllowed('administrator'));

        // Some checks on specific areas, which inherit access controls from the root ACL node
        $this->_acl->add(new Zend_Acl_Resource('newsletter'))
                   ->add(new Zend_Acl_Resource('pending'), 'newsletter')
                   ->add(new Zend_Acl_Resource('gallery'))
                   ->add(new Zend_Acl_Resource('profiles', 'gallery'))
                   ->add(new Zend_Acl_Resource('config'))
                   ->add(new Zend_Acl_Resource('hosts'), 'config');
        $this->assertTrue($this->_acl->isAllowed('guest', 'pending', 'view'));
        $this->assertTrue($this->_acl->isAllowed('staff', 'profiles', 'revise'));
        $this->assertTrue($this->_acl->isAllowed('staff', 'pending', 'view'));
        $this->assertTrue($this->_acl->isAllowed('staff', 'pending', 'edit'));
        $this->assertFalse($this->_acl->isAllowed('staff', 'pending', 'publish'));
        $this->assertFalse($this->_acl->isAllowed('staff', 'pending'));
        $this->assertFalse($this->_acl->isAllowed('editor', 'hosts', 'unknown'));
        $this->assertTrue($this->_acl->isAllowed('administrator', 'pending'));

        // Add a new group, marketing, which bases its permissions on staff
        $this->_acl->addRole(new Zend_Acl_Role('marketing'), 'staff');

        // Refine the privilege sets for more specific needs

        // Allow marketing to publish and archive newsletters
        $this->_acl->allow('marketing', 'newsletter', array('publish', 'archive'));

        // Allow marketing to publish and archive latest news
        $this->_acl->add(new Zend_Acl_Resource('news'))
                   ->add(new Zend_Acl_Resource('latest'), 'news');
        $this->_acl->allow('marketing', 'latest', array('publish', 'archive'));

        // Deny staff (and marketing, by inheritance) rights to revise latest news
        $this->_acl->deny('staff', 'latest', 'revise');

        // Deny everyone access to archive news announcements
        $this->_acl->add(new Zend_Acl_Resource('announcement'), 'news');
        $this->_acl->deny(null, 'announcement', 'archive');

        // Access control checks for the above refined permission sets

        $this->assertTrue($this->_acl->isAllowed('marketing', null, 'view'));
        $this->assertTrue($this->_acl->isAllowed('marketing', null, 'edit'));
        $this->assertTrue($this->_acl->isAllowed('marketing', null, 'submit'));
        $this->assertTrue($this->_acl->isAllowed('marketing', null, 'revise'));
        $this->assertFalse($this->_acl->isAllowed('marketing', null, 'publish'));
        $this->assertFalse($this->_acl->isAllowed('marketing', null, 'archive'));
        $this->assertFalse($this->_acl->isAllowed('marketing', null, 'delete'));
        $this->assertFalse($this->_acl->isAllowed('marketing', null, 'unknown'));
        $this->assertFalse($this->_acl->isAllowed('marketing'));

        $this->assertTrue($this->_acl->isAllowed('marketing', 'newsletter', 'publish'));
        $this->assertFalse($this->_acl->isAllowed('staff', 'pending', 'publish'));
        $this->assertTrue($this->_acl->isAllowed('marketing', 'pending', 'publish'));
        $this->assertTrue($this->_acl->isAllowed('marketing', 'newsletter', 'archive'));
        $this->assertFalse($this->_acl->isAllowed('marketing', 'newsletter', 'delete'));
        $this->assertFalse($this->_acl->isAllowed('marketing', 'newsletter'));

        $this->assertTrue($this->_acl->isAllowed('marketing', 'latest', 'publish'));
        $this->assertTrue($this->_acl->isAllowed('marketing', 'latest', 'archive'));
        $this->assertFalse($this->_acl->isAllowed('marketing', 'latest', 'delete'));
        $this->assertFalse($this->_acl->isAllowed('marketing', 'latest', 'revise'));
        $this->assertFalse($this->_acl->isAllowed('marketing', 'latest'));

        $this->assertFalse($this->_acl->isAllowed('marketing', 'announcement', 'archive'));
        $this->assertFalse($this->_acl->isAllowed('staff', 'announcement', 'archive'));
        $this->assertFalse($this->_acl->isAllowed('administrator', 'announcement', 'archive'));

        $this->assertFalse($this->_acl->isAllowed('staff', 'latest', 'publish'));
        $this->assertFalse($this->_acl->isAllowed('editor', 'announcement', 'archive'));

        // Remove some previous permission specifications

        // Marketing can no longer publish and archive newsletters
        $this->_acl->removeAllow('marketing', 'newsletter', array('publish', 'archive'));

        // Marketing can no longer archive the latest news
        $this->_acl->removeAllow('marketing', 'latest', 'archive');

        // Now staff (and marketing, by inheritance) may revise latest news
        $this->_acl->removeDeny('staff', 'latest', 'revise');

        // Access control checks for the above refinements

        $this->assertFalse($this->_acl->isAllowed('marketing', 'newsletter', 'publish'));
        $this->assertFalse($this->_acl->isAllowed('marketing', 'newsletter', 'archive'));

        $this->assertFalse($this->_acl->isAllowed('marketing', 'latest', 'archive'));

        $this->assertTrue($this->_acl->isAllowed('staff', 'latest', 'revise'));
        $this->assertTrue($this->_acl->isAllowed('marketing', 'latest', 'revise'));

        // Grant marketing all permissions on the latest news
        $this->_acl->allow('marketing', 'latest');

        // Access control checks for the above refinement
        $this->assertTrue($this->_acl->isAllowed('marketing', 'latest', 'archive'));
        $this->assertTrue($this->_acl->isAllowed('marketing', 'latest', 'publish'));
        $this->assertTrue($this->_acl->isAllowed('marketing', 'latest', 'edit'));
        $this->assertTrue($this->_acl->isAllowed('marketing', 'latest'));

    }

    /**
     * Ensures that the $onlyParents argument to inheritsRole() works
     *
     * @return void
     * @group ZF-2502
     */
    public function testRoleInheritanceSupportsCheckingOnlyParents()
    {
        $this->_acl->addRole(new Zend_Acl_Role('grandparent'))
                   ->addRole(new Zend_Acl_Role('parent'), 'grandparent')
                   ->addRole(new Zend_Acl_Role('child'), 'parent');
        $this->assertFalse($this->_acl->inheritsRole('child', 'grandparent', true));
    }

    /**
     * Ensures that the solution for ZF-2234 works as expected
     *
     * @return void
     * @group ZF-2234
     */
    public function testAclInternalDFSMethodsBehaveProperly()
    {
        require_once dirname(__FILE__) . '/_files/ExtendedAclZF2234.php';
        $acl = new Zend_Acl_ExtendedAclZF2234();

        $someResource = new Zend_Acl_Resource('someResource');
        $someRole     = new Zend_Acl_Role('someRole');

        $acl->add($someResource)
            ->addRole($someRole);

        $nullValue     = null;
        $nullReference =& $nullValue;

        try {
            $acl->roleDFSVisitAllPrivileges($someRole, $someResource, $nullReference);
            $this->fail('Expected Zend_Acl_Exception not thrown');
        } catch (Zend_Acl_Exception $e) {
            $this->assertEquals('$dfs parameter may not be null', $e->getMessage());
        }

        try {
            $acl->roleDFSOnePrivilege($someRole, $someResource, null);
            $this->fail('Expected Zend_Acl_Exception not thrown');
        } catch (Zend_Acl_Exception $e) {
            $this->assertEquals('$privilege parameter may not be null', $e->getMessage());
        }

        try {
            $acl->roleDFSVisitOnePrivilege($someRole, $someResource, null);
            $this->fail('Expected Zend_Acl_Exception not thrown');
        } catch (Zend_Acl_Exception $e) {
            $this->assertEquals('$privilege parameter may not be null', $e->getMessage());
        }

        try {
            $acl->roleDFSVisitOnePrivilege($someRole, $someResource, 'somePrivilege', $nullReference);
            $this->fail('Expected Zend_Acl_Exception not thrown');
        } catch (Zend_Acl_Exception $e) {
            $this->assertEquals('$dfs parameter may not be null', $e->getMessage());
        }
    }

    /**
     * @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
     */
    public function testAclAssertionsGetOriginalIsAllowedObjects()
    {
        $acl = $this->_loadUseCase1();

        $user = new Zend_Acl_UseCase1_User();
        $blogPost = new Zend_Acl_UseCase1_BlogPost();

        $this->assertTrue($acl->isAllowed($user, $blogPost, 'view'));

        /**
         * @var Zend_Acl_UseCase1_UserIsBlogPostOwnerAssertion
         */
        $assertion = $acl->customAssertion;

        $assertion->assertReturnValue = true;
        $user->role = 'contributor';
        $this->assertTrue($acl->isAllowed($user, $blogPost, 'modify'), 'Assertion should return true');
        $assertion->assertReturnValue = false;
        $this->assertFalse($acl->isAllowed($user, $blogPost, 'modify'), 'Assertion should return false');

        // check to see if the last assertion has the proper objets
        $this->assertTrue($assertion->lastAssertRole instanceof Zend_Acl_UseCase1_User, 'Assertion did not recieve proper role object');
        $this->assertTrue($assertion->lastAssertResource instanceof Zend_Acl_UseCase1_BlogPost, 'Assertion did not recieve proper resource object');

    }

    /**
     *
     * @return Zend_Acl_UseCase1_Acl
     */
    protected function _loadUseCase1()
    {
        if (!class_exists('Zend_Acl_UseCase1_Acl')) {
            require_once dirname(__FILE__) . '/_files/UseCase1/User.php';
            require_once dirname(__FILE__) . '/_files/UseCase1/BlogPost.php';
            require_once dirname(__FILE__) . '/_files/UseCase1/UserIsBlogPostOwnerAssertion.php';
            require_once dirname(__FILE__) . '/_files/UseCase1/Acl.php';
        }
        return new Zend_Acl_UseCase1_Acl();
    }

    /**
     * Returns an array of registered roles
     * @expectedException PHPUnit_Framework_Error
     * @group ZF-5638
     */
    public function testGetRegisteredRoles()
    {
        $acl = $this->_acl;
        $acl->addRole('developer');

        $roles = $acl->getRegisteredRoles();
        $this->assertTrue(is_array($roles));
        $this->assertFalse(empty($roles));
    }

    /**
     * Confirm that deleting a role after allowing access to all roles
     * raise undefined index error
     *
     * @group ZF-5700
     */
    public function testRemovingRoleAfterItWasAllowedAccessToAllResourcesGivesError()
    {
        $acl = new Zend_Acl();
        $acl->addRole(new Zend_Acl_Role('test0'));
        $acl->addRole(new Zend_Acl_Role('test1'));
        $acl->addRole(new Zend_Acl_Role('test2'));
        $acl->addResource(new Zend_Acl_Resource('Test'));

        $acl->allow(null,'Test','xxx');

        // error test
        $acl->removeRole('test0');

        // Check after fix
        $this->assertFalse($acl->hasRole('test0'));
    }

    /**
     * @group ZF-8039
     *
     * Meant to test for the (in)existance of this notice:
     * "Notice: Undefined index: allPrivileges in lib/Zend/Acl.php on line 682"
     */
    public function testMethodRemoveAllowDoesNotThrowNotice() {
        $acl = new Zend_Acl();
        $acl->addRole('admin');
        $acl->addResource('blog');
        $acl->allow('admin', 'blog', 'read');
        $acl->removeAllow(array('admin'), array('blog'), null);
    }

    public function testRoleObjectImplementsToString() {
        $role = new Zend_Acl_Role('_fooBar_');
        $this->assertEquals('_fooBar_',(string)$role);
    }

    public function testResourceObjectImplementsToString() {
        $resource = new Zend_Acl_Resource('_fooBar_');
        $this->assertEquals('_fooBar_',(string)$resource);
    }

    /**
     * @group ZF-7973
     */
    public function testAclPassesPrivilegeToAssertClass() {
        require_once dirname(__FILE__) . '/_files/AssertionZF7973.php';
        $assertion = new Zend_Acl_AclTest_AssertionZF7973();

        $acl = new Zend_Acl();
        $acl->addRole('role');
        $acl->addResource('resource');
        $acl->allow('role',null,null,$assertion);
        $allowed = $acl->isAllowed('role','resource','privilege',$assertion);

        $this->assertTrue($allowed);
    }

    /**
     * @group ZF-8468
     */
    public function testGetRegisteredRolesIsDeprecated() {
        try {
            $this->_acl->getRegisteredRoles();
            $this->fail('getRegisteredRoles() did not throw an exception');
        } catch(PHPUnit_Framework_Error $e) {
            return;
        }

        $this->fail('An expected notice has not been raised');
    }

    /**
     * @group ZF-8468
     */
    public function testgetRoles() {
        $this->assertEquals(array(),$this->_acl->getRoles());

        $roleGuest = new Zend_Acl_Role('guest');
        $this->_acl->addRole($roleGuest);
        $this->_acl->addRole(new Zend_Acl_Role('staff'), $roleGuest);
        $this->_acl->addRole(new Zend_Acl_Role('editor'), 'staff');
        $this->_acl->addRole(new Zend_Acl_Role('administrator'));

        $expected = array('guest', 'staff','editor','administrator');
        $this->assertEquals($expected, $this->_acl->getRoles());
    }

    /**
     * @group ZF-8468
     */
    public function testgetResources() {
        $this->assertEquals(array(),$this->_acl->getResources());

        $this->_acl->add(new Zend_Acl_Resource('someResource'));
        $this->_acl->add(new Zend_Acl_Resource('someOtherResource'));

        $expected = array('someResource', 'someOtherResource');
        $this->assertEquals($expected, $this->_acl->getResources());
    }

    /**
     * @group ZF-9643
     */
    public function testRemoveAllowWithNullResourceAfterResourceSpecificRulesAppliesToAllResources()
    {
        $this->_acl->addRole('guest');
        $this->_acl->addResource('blogpost');
        $this->_acl->addResource('newsletter');
        $this->_acl->allow('guest', 'blogpost', 'read');
        $this->_acl->allow('guest', 'newsletter', 'read');
        $this->assertTrue($this->_acl->isAllowed('guest', 'blogpost', 'read'));
        $this->assertTrue($this->_acl->isAllowed('guest', 'newsletter', 'read'));

        $this->_acl->removeAllow('guest', 'newsletter', 'read');
        $this->assertTrue($this->_acl->isAllowed('guest', 'blogpost', 'read'));
        $this->assertFalse($this->_acl->isAllowed('guest', 'newsletter', 'read'));

        $this->_acl->removeAllow('guest', null, 'read');
        $this->assertFalse($this->_acl->isAllowed('guest', 'blogpost', 'read'));
        $this->assertFalse($this->_acl->isAllowed('guest', 'newsletter', 'read'));

        // ensure allow null/all resoures works
        $this->_acl->allow('guest', null, 'read');
        $this->assertTrue($this->_acl->isAllowed('guest', 'blogpost', 'read'));
        $this->assertTrue($this->_acl->isAllowed('guest', 'newsletter', 'read'));
    }

    /**
     * @group ZF-9643
     */
    public function testRemoveDenyWithNullResourceAfterResourceSpecificRulesAppliesToAllResources()
    {
        $this->_acl->addRole('guest');
        $this->_acl->addResource('blogpost');
        $this->_acl->addResource('newsletter');

        $this->_acl->allow();
        $this->_acl->deny('guest', 'blogpost', 'read');
        $this->_acl->deny('guest', 'newsletter', 'read');
        $this->assertFalse($this->_acl->isAllowed('guest', 'blogpost', 'read'));
        $this->assertFalse($this->_acl->isAllowed('guest', 'newsletter', 'read'));

        $this->_acl->removeDeny('guest', 'newsletter', 'read');
        $this->assertFalse($this->_acl->isAllowed('guest', 'blogpost', 'read'));
        $this->assertTrue($this->_acl->isAllowed('guest', 'newsletter', 'read'));

        $this->_acl->removeDeny('guest', null, 'read');
        $this->assertTrue($this->_acl->isAllowed('guest', 'blogpost', 'read'));
        $this->assertTrue($this->_acl->isAllowed('guest', 'newsletter', 'read'));

        // ensure deny null/all resources works
        $this->_acl->deny('guest', null, 'read');
        $this->assertFalse($this->_acl->isAllowed('guest', 'blogpost', 'read'));
        $this->assertFalse($this->_acl->isAllowed('guest', 'newsletter', 'read'));
    }

    /**
     * @group ZF-10649
     */
    public function testAllowAndDenyWithNullForResourcesWillApplyToAllResources()
    {
        $this->_acl->addRole('guest');
        $this->_acl->addResource('blogpost');

        $this->_acl->allow('guest');
        $this->assertTrue($this->_acl->isAllowed('guest'));
        $this->assertTrue($this->_acl->isAllowed('guest', 'blogpost'));
        $this->assertTrue($this->_acl->isAllowed('guest', 'blogpost', 'read'));

        $this->_acl->deny('guest');
        $this->assertFalse($this->_acl->isAllowed('guest'));
        $this->assertFalse($this->_acl->isAllowed('guest', 'blogpost'));
        $this->assertFalse($this->_acl->isAllowed('guest', 'blogpost', 'read'));
    }
}

redpajama_set_name: RedPajamaGithub


text:
Putin's world
Illustrated | LuminaStock/iStock, KAY NIETFELD/AFP/Getty Images
Why is President Trump so enamored with Vladimir Putin?
It's impossible to miss Trump's regular warm remarks about the Russian leader, and his weirdly deferential policy suggestions — like letting Russia back in the G-7. Clearly, either Trump simply likes Putin and his style of politics, or Putin has some kind of secret leverage on Trump, or both.
Whatever the reason, this is very bad for America and the world. Putin is a vicious authoritarian who is building an international reactionary movement, with considerable success. America must not be allowed to join such a project.
Despite Trump and Putin's protestations otherwise, Russia very obviously mucked up America's presidential election in 2016. (Whether the Trump campaign had any hand in this remains unproven, and an open question.) While Russia's 2016 influence is typically wildly overstated (the largest factor in Democrats' loss was definitely Hillary Clinton's severe unpopularity), it seems very probable that Russian meddling had a real, if smaller, effect.
On Friday, Deputy Attorney General Rod Rosenstein and Special Counsel Robert Mueller released an indictment of 12 Russian hackers apparently revealing that they attempted to hack Clinton's emails the very night in July 2016 after Trump publicly suggested they should. For anyone who believes in democracy, this ought to be a seriously troubling development.
But look beyond Russia's relatively minor U.S. election meddling. What's troubling about Trump's embrace of Putin isn't about what happened in 2016 — it's about what might happen in the future.
It is beyond question that Putin is an extraordinarily sinister figure. He has cored out Russia's democratic institutions and set himself up as a right-wing quasi-dictator, encouraging violent nationalism and various forms of bigotry (particularly homophobia) in Russia. One key mechanism of control is assaulting, imprisoning, and occasionally murdering his political opponents.
Moreover, as Ben Ross suggests, he is also setting himself up as a leader of an erstwhile international alliance of right-wing nationalists, racists, and plutocrats — a return of sorts of the Holy Alliance. He is close with the far-right Viktor Orban in Hungary, who has thrown many wrenches into European Union mechanisms on Putin's orders, as well as the right-wing butcher Rodrigo Duterte in the Philippines. China's President Xi Jinping — who also just finished removing all barriers to his personal power — recently awarded Putin the "Friendship Medal" in a lavish ceremony. The Chinese government is ostensibly communist, but as seen by its overseas investments and brutal treatment of its own working class, it is really just authoritarian. Putin and Xi are similar types of leaders, and hence have no trouble working together.
This isn't even to mention Putin's long history of backing Bashar al-Assad in Syria, plus his various entanglements with Hezbollah and Iran.
Now, the American-led Western alliance system has had its share of problems, to say the least. Often it has enabled terrible crimes or economic carnage. But it also underpinned a great deal of the world's recent peace and success — particularly in Western Europe, which used to be among the most blood-drenched places on Earth but has not had a war of any kind since 1945. And it was set up on a foundation dedicated to democracy and human rights — a commitment often honored in the breach, but also providing a crack for suffering peoples around the world to demand restitution, with occasional success.
It would be a great error to celebrate the dissolution of the Western alliance as some victory for human rights or oppressed peoples around the world. The most likely candidate to fill the power vacuum would be exactly this loose group of merciless authoritarians who will roll back much of what makes America and Europe good places to live, while exploiting the developing world at least as much as the West has done — and probably quite a bit more.
Last week, I argued that Trump's Republican Party has regressed to a pinched, hateful, America-first conception of international relations. I think that is still true of the conservative base — the overwhelming majority of whom probably could not even find the Philippines or Hungary on a map, let alone endorse entering into an alliance with those countries. But as shown by the twists and turns of sentiment among the Republican base (who now hate the FBI and the NFL), they are also quite obviously going to follow Trump no matter what he does.
The nuclear-armed Putin cannot and should not be beaten with military force, obviously. But where he is building an international alliance of reactionaries, he should be confronted with an international alliance of clear-thinking conservatives, moderates, liberals, social democrats, and socialists who can agree on a basic social structure of democracy, human rights, and civil liberties — thus saving and reconstructing the Western alliance to actually live up to its ideals at the same time. We simply can't take this lying down.
More Perspectives
James Pethokoukis
Trump just ran a two-year trade war experiment. It failed.
Edward Morrissey
Did Trump bet 2020 on Iran?
More from Ryan Cooper
Is the media about to have a conniption fit over Bernie Sanders?
Ukraine gives Trump the corruption investigation he asked for
Bernie Sanders' crystal clear contrast with Trump
The Week Staff

redpajama_set_name: RedPajamaCommonCrawl


text:
Em química orgânica, a regra de Hückel estima se uma molécula em anel planar terá propriedades aromáticas. A mecânica quântica básica para sua formulação foi elaborada pelo físico-químico Erich Hückel em 1931. A expressão sucinta como a regra 4n+2 tem sido atribuída a von Doering (1951), apesar de vários autores estarem usando esta fórmula aproximadamente a mesma época.

Uma molécula em anel cíclica segue a regra de Hückel quando o número dos seus elétrons π é igual a 4n+2, onde n é zero ou inteiro positivo, apesar de, historicamente, exemplos claros serem realmente estabelecidos apenas para valores de n=0 até cerca de n=6. Em 2019, no entanto, Michel Rickhaus e outros colegas da Universidade de Oxford, Reino Unido, desenvolveram uma molécula que contém 162 elétrons π (n=40), que segue a regra de Hückel e também as evidências físicas sob influência de campos magnéticos. A regra de Hückel foi originalmente baseada em cálculos usando o método de Hückel, embora também possa ser justificada por considerar o sistema como partículas em um anel, pelo método CLOA e pelo método Pariser–Parr–Pople.

Os compostos aromáticos são mais estáveis que o teoricamente previsto pelos dados de hidrogenação de alcenos; a estabilidade "extra" é devida à nuvem de elétrons deslocalizados, chamada de energia de ressonância. Critérios para aromáticos simples são:

 seguir a regra Huckel, tendo 4n+2 elétrons na nuvem deslocalizada;
 ser capaz de ser planar e cíclico;
 cada átomo no círculo é capaz de participar na deslocalização dos elétrons por ter um orbital p ou um par de elétrons não compartilhados.

Físico-química
Química orgânica
Físico-química orgânica

redpajama_set_name: RedPajamaWikipedia


text:
using System.Collections.Immutable;
using System.Globalization;
using System.Linq;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Editor.Host;
using Microsoft.VisualStudio.Language.Intellisense;
using Microsoft.VisualStudio.Text;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.Editor.Implementation.Suggestions
{
    /// <summary>
    /// Represents light bulb menu item for code fixes.
    /// </summary>
    internal class CodeFixSuggestedAction : SuggestedActionWithFlavors, ITelemetryDiagnosticID<string>
    {
        private readonly CodeFix _fix;
        private readonly SuggestedActionSet _fixAllSuggestedActionSet;

        public CodeFixSuggestedAction(
            Workspace workspace,
            ITextBuffer subjectBuffer,
            ICodeActionEditHandlerService editHandler,
            IWaitIndicator waitIndicator,
            CodeFix fix,
            CodeAction action,
            object provider,
            SuggestedActionSet fixAllSuggestedActionSet)
            : base(workspace, subjectBuffer, editHandler, waitIndicator, action, provider)
        {
            _fix = fix;
            _fixAllSuggestedActionSet = fixAllSuggestedActionSet;
        }

        /// <summary>
        /// If the provided fix all context is non-null and the context's code action Id matches the given code action's Id then,
        /// returns the set of fix all occurrences actions associated with the code action.
        /// </summary>
        internal static SuggestedActionSet GetFixAllSuggestedActionSet(
            CodeAction action,
            int actionCount,
            FixAllCodeActionContext fixAllCodeActionContext,
            Workspace workspace,
            ITextBuffer subjectBuffer,
            ICodeActionEditHandlerService editHandler,
            IWaitIndicator waitIndicator)
        {
            if (fixAllCodeActionContext == null)
            {
                return null;
            }

            if (actionCount > 1 && action.EquivalenceKey == null)
            {
                return null;
            }

            var fixAllSuggestedActions = ImmutableArray.CreateBuilder<FixAllSuggestedAction>();
            foreach (var scope in fixAllCodeActionContext.SupportedScopes)
            {
                var fixAllContext = fixAllCodeActionContext.GetContextForScopeAndActionId(scope, action.EquivalenceKey);
                var fixAllAction = new FixAllCodeAction(fixAllContext, fixAllCodeActionContext.FixAllProvider, showPreviewChangesDialog: true);
                var fixAllSuggestedAction = new FixAllSuggestedAction(workspace, subjectBuffer, editHandler, waitIndicator,
                    fixAllAction, fixAllCodeActionContext.FixAllProvider, fixAllCodeActionContext.OriginalDiagnostics.First());
                fixAllSuggestedActions.Add(fixAllSuggestedAction);
            }

            return new SuggestedActionSet(fixAllSuggestedActions.ToImmutable(), title: EditorFeaturesResources.FixAllOccurrencesIn);
        }

        public string GetDiagnosticID()
        {
            var diagnostic = _fix.PrimaryDiagnostic;

            // we log diagnostic id as it is if it is from us
            if (diagnostic.Descriptor.CustomTags.Any(t => t == WellKnownDiagnosticTags.Telemetry))
            {
                return diagnostic.Id;
            }

            // if it is from third party, we use hashcode
            return diagnostic.GetHashCode().ToString(CultureInfo.InvariantCulture);
        }

        protected override DiagnosticData GetDiagnostic()
        {
            return _fix.GetPrimaryDiagnosticData();
        }

        protected override SuggestedActionSet GetFixAllSuggestedActionSet()
        {
            return _fixAllSuggestedActionSet;
        }
    }
}


text:
Here's how to charge your Switch through a MacBook
For all of those Apple fans
By Julia Alexander Mar 3, 2017, 8:30am EST
Share All sharing options for: Here's how to charge your Switch through a MacBook
There's currently only a few ways to charge the Nintendo Switch, none of which are overly convenient.
One of the suggestions that has been made since Nintendo first announced the specs for the system is plugging the console into a new MacBook or MacBook Pro. The Switch uses a USB-C port to charge — the same port Apple's new line of MacBook and MacBook Pros use. Hypothetically, someone could use a power adapter to charge the MacBook, and then, using a USB-C to USB-C cable to connect the two, could charge the Switch.
Turns out the theory was correct. First reported on Twitter by a Quartz reporter and confirmed by Polygon, connecting a powered-down Switch to a MacBook or MacBook Pro will charge the console. Quartz reported that while the Switch is active, it will charge a MacBook Pro. Polygon tested the theory on a 2015 MacBook and was unable to confirm that a Switch would charge the laptop.
In the photo below, the Switch is completely powered off, and the battery charging symbol can be seen in the upper left hand corner.
Jeff Ramos/Polygon
This shouldn't be too surprising, but the fact that the smaller system (the Switch has a 4310 mAh, 3.7 V lithium-ion battery that uses 39W of power) would power the larger system (the MacBook Pro has a 54.5 Wh lithium-polymer battery and can take up to 61 W of power) is interesting. There isn't an option to choose which system you'd like to charge through the USB-C cable, but it's natural to assume the MacBook would charge the Switch, even if Quartz is reporting that the opposite can occur when the console is off.
A good comparison is the automatic change of flow in power when you connect your phone to your computer. The iPhone or Android phone doesn't charge your computer, either when it's on or off, but the computer seems to inherently know to charge the phone.
It should also be noted that if you're planning on picking up extra charging tools for your Switch, it might be best to buy a wall charger for a MacBook Pro. The extra boost in power should, hypothetically, charge the console at a faster speed.
The Nintendo Switch will be available to pick up on March 3. If you're still on the fence about buying one at launch, check out our in-depth review of the system.
Watch: Nintendo Switch Hardware Review
Next Up In Nintendo Switch


PETALING JAYA: Every Valentine's day since the year 2000, the world has experienced a wave of malicious love-related viruses which spread through the combination of e-mail and infected websites, according to Internet content security company Trend Micro.
The virus has gone by many aliases over the years. Typically, in the few weeks leading up to Valentine's Day, "love" messages flood e-mail inboxes all over the world.
These e-mail messages would contain a link that redirects a user to a website with heart images in the background. When this page is clicked, the user is prompted to download a malicious file, detected by Trend Micro this year as WORM_WALEDEC.AR.
The purpose of the virus is to compromise the security of infected systems by opening random ports to listen for commands from a remote user. This makes the computer extremely vulnerable to infiltration, Trend Micro warned.
To combat this, the company is offering a patch for its customers as well as a free malware scanner and cleaner for anyone wanting to clear the virus off their computers.
For non-Trend Micro customers, the link to the scanner is housecall.trendmicro.com.
Trend Micro customers can download the patch at us.trendmicro.com/us/products/ enterprise/web-protection-add-on.
For more information of the virus itself, other threats and general Internet security issues, visit blog.trendmicro.com.
Valentine's Day Giveaway! FREE Norton Antivirus!