Beispiel #1
0
 public function testRemoveResourceFromSequence()
 {
     $graph = new ExtendedGraph();
     $s = 'http://sequence';
     $sub1 = 'http://sub1';
     $sub2 = 'http://sub2';
     $sub3 = 'http://sub3';
     $graph->add_resource_to_sequence($s, $sub1);
     $graph->add_resource_to_sequence($s, $sub2);
     $graph->add_resource_to_sequence($s, $sub3);
     $graph->remove_resource_from_sequence($s, $sub2);
     $sequenceValues = $graph->get_sequence_values($s);
     $this->assertEquals(array($sub1, $sub3), $sequenceValues, 'There should be two sequence values, in the correct order');
     $this->assertTrue($graph->has_resource_triple($s, ExtendedGraph::rdf . "_1", $sub1));
     $this->assertTrue($graph->has_resource_triple($s, ExtendedGraph::rdf . "_2", $sub3));
 }
 /**
  * @param \Tripod\ExtendedGraph $graph
  * @param string $s
  * @param string $p
  * @param string $o
  */
 protected function assertDoesNotHaveResourceTriple(\Tripod\ExtendedGraph $graph, $s, $p, $o)
 {
     $this->assertFalse($graph->has_resource_triple($s, $p, $o), "Graph should not contain the resource triple: <{$s}> <{$p}> <{$o}>");
 }