/** * Constructor. * * The input array must be in the form: array(-42 => true, 3 => true, 4 => false) * or an equivalent JSON encoded string. * * @param mixed $identities A JSON format string (probably from the database) or a named array. * * @since 11.1 * @deprecated 12.3 */ public function __construct($identities) { JLog::add('JRule is deprecated. Use JAccessRule instead.', JLog::WARNING, 'deprecated'); parent::__construct($identities); }
/** * Tests the JAccessRule::allow method. * * @return void * * @since 11.1 */ public function testAllow() { // Simple allow and deny test. $array = array(-42 => 0, 2 => 1); $rule = new JAccessRule($array); // This one should be denied. $this->assertFalse($rule->allow(-42)); $this->assertEquals(null, $rule->allow(null)); // This one should be allowed. $this->assertTrue($rule->allow(2)); // This one should be denied. $this->assertFalse($rule->allow(array(-42, 2))); }