Skip to content
This repository has been archived by the owner on Aug 5, 2020. It is now read-only.

Commit

Permalink
StoreAbstractTest: added new test to check that all triples were remo…
Browse files Browse the repository at this point in the history
…ved after dropGraph call
  • Loading branch information
k00ni committed Jun 23, 2017
1 parent 4c909c7 commit 726fc00
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/Saft/Store/Test/StoreAbstractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1241,4 +1241,34 @@ public function testQueryScenarioEmptyResult()

$this->assertCountStatementIterator(0, $result);
}

// tests that query returns no triples after dropGraph call
public function testRemovalOfTriplesAfterDropGraph()
{
// add test triples to graph
$this->fixture->addStatements(
array(
new StatementImpl(
$this->testGraph,
$this->testGraph,
$this->testGraph,
$this->testGraph
),
new StatementImpl(
$this->testGraph,
$this->nodeFactory->createNamedNode('http://foobar/1'),
$this->nodeFactory->createNamedNode('http://foobar/2'),
$this->testGraph
)
)
);

$result = $this->fixture->query('SELECT * FROM <'. $this->testGraph .'> WHERE { ?s ?p ?o. }');
$this->assertEquals(2, count($result));

$this->fixture->dropGraph($this->testGraph);

$result = $this->fixture->query('SELECT * FROM <'. $this->testGraph .'> WHERE { ?s ?p ?o. }');
$this->assertEquals(0, count($result));
}
}

0 comments on commit 726fc00

Please sign in to comment.