/** * Tests the JAccessRule::mergeIdentity method. * * @return void * * @since 11.1 */ public function testMergeIdentity() { // Construct an rule with no identities. $rule = new JAccessRule(''); // Add the identity with allow. $rule->mergeIdentity(-42, true); $this->assertEquals('{"-42":1}', (string) $rule); // Readd the identity, but deny. $rule->mergeIdentity(-42, false); $this->assertEquals('{"-42":0}', (string) $rule); // Readd the identity with allow (checking deny wins). $rule->mergeIdentity(-42, true); $this->assertEquals('{"-42":0}', (string) $rule); }