Exemplo n.º 1
0
 function testSubtract()
 {
     $_SESSION['test'] = 'MemModel subtract test';
     $model1 = new MemModel();
     $stat = new Statement(new Resource('http://www.example.org/sub1'), new Resource('http://www.example.org/pred1'), new Resource('http://www.example.org/obj1'));
     $stat2 = new Statement(new Resource('http://www.example.org/sub2'), new Resource('http://www.example.org/pred2'), new Resource('http://www.example.org/obj2'));
     $stat3 = new Statement(new Resource('http://www.example.org/sub3'), new Resource('http://www.example.org/pred3'), new Resource('http://www.example.org/obj3'));
     $model1->add($stat);
     $model1->add($stat2);
     $model2 = new MemModel();
     $model2->add($stat);
     $model2->add($stat2);
     $model2->add($stat3);
     $res = new MemModel();
     $res = $model2->subtract($model1);
     $this->assertEqual(1, $res->size());
     $this->assertTrue($res->contains($stat3));
 }