public function testEmptyEntitlement() { $s = new Entitlement(); $this->assertTrue($s->isEmpty()); $this->assertTrue($s->equals(new Entitlement())); $this->assertFalse($s->hasEntitlement(new Entitlement(array("foo")))); $this->assertTrue($s->hasEntitlement(new Entitlement())); $this->assertTrue($s->hasAnyEntitlement(new Entitlement())); }
public function hasAnyEntitlement(Entitlement $that) { if ($that->isEmpty()) { return true; } foreach ($that->toArray() as $s) { if (in_array($s, $this->toArray())) { return true; } } return false; }