public function equals(Scope $that) { $thisScope = $this->toArray(); $thatScope = $that->toArray(); foreach ($thisScope as $s) { if (!in_array($s, $thatScope)) { return false; } } foreach ($thatScope as $s) { if (!in_array($s, $thisScope)) { return false; } } return true; }
public function testSerialize() { $s = new Scope(array('foo', 'bar', 'baz')); $t = new Scope($s->toArray()); $this->assertTrue($t->equals($s)); }