示例#1
0
文件: Scope.php 项目: Farik2605/tobi
 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));
 }