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

Commit

Permalink
Test: added property statementFactory; overall refinements; Store: im…
Browse files Browse the repository at this point in the history
…proved test cov.

* marked StoreAbstractTest with @codeCoverageIgnore
* added tests in AbstractSparqlStoreTest
  • Loading branch information
k00ni committed May 16, 2017
1 parent 736d04a commit 1474c2a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
13 changes: 12 additions & 1 deletion NodeFactoryImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class NodeFactoryImpl implements NodeFactory
{
/**
* @var NodeUtils
* @var RdfHelpers
*/
protected $rdfHelpers;

Expand All @@ -21,6 +21,7 @@ public function __construct(RdfHelpers $rdfHelpers)
* @param string $value
* @param Node|string $datatype (optional)
* @param string $lang (optional)
* @return Literal
*/
public function createLiteral($value, $datatype = null, $lang = null)
{
Expand All @@ -34,16 +35,25 @@ public function createLiteral($value, $datatype = null, $lang = null)
return new LiteralImpl($this->rdfHelpers, $value, $datatype, $lang);
}

/*
* @return NamedNode
*/
public function createNamedNode($uri)
{
return new NamedNodeImpl($this->rdfHelpers, $uri);
}

/*
* @return BlankNode
*/
public function createBlankNode($blankId)
{
return new BlankNodeImpl($blankId);
}

/*
* @return AnyPattern
*/
public function createAnyPattern()
{
return new AnyPatternImpl();
Expand All @@ -53,6 +63,7 @@ public function createAnyPattern()
* Creates an RDF Node based on a N-Triples/N-Quads node string.
*
* @param $string string the N-Triples/N-Quads node string
* @return Node
* @throws \Exception if no node could be created e.g. because of a syntax error in the node string
*/
public function createNodeFromNQuads($string)
Expand Down
3 changes: 3 additions & 0 deletions Test/StatementAbstractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,13 @@ public function testIsConcrete()

$this->assertFalse($fixtureA->isConcrete());
$this->assertTrue($fixtureA->isPattern());

$this->assertTrue($fixtureB->isConcrete());
$this->assertFalse($fixtureB->isPattern());

$this->assertFalse($fixtureC->isConcrete());
$this->assertTrue($fixtureC->isPattern());

$this->assertTrue($fixtureD->isConcrete());
$this->assertFalse($fixtureD->isPattern());
}
Expand Down

0 comments on commit 1474c2a

Please sign in to comment.