Skip to content

Commit

Permalink
Merge pull request #1212 from NatLibFi/fix-notation-data-type-tests
Browse files Browse the repository at this point in the history
Fix notation data type tests
  • Loading branch information
osma authored Sep 16, 2021
2 parents c960e09 + 15b1300 commit fbe2be0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion model/ConceptPropertyValueLiteral.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function getDatatype(): ?string
$dtLabel = $graph->resource($datatype)->label($this->clang);
return $dtLabel->getValue();
}
return "";
return null;
}

public function getType()
Expand Down
8 changes: 4 additions & 4 deletions tests/ConceptPropertyValueLiteralTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function testGetLabelThatIsABrokenDate() {
}

/**
* @covers ConceptPropertyValueLiteral::getLabel
* @covers ConceptPropertyValueLiteral::getDatatype
*/
public function testGetLabelForDatatype() {
$vocab = $this->model->getVocabulary('test');
Expand All @@ -74,18 +74,18 @@ public function testGetLabelForDatatype() {
}

/**
* @covers ConceptPropertyValueLiteral::getLabel
* @covers ConceptPropertyValueLiteral::getDatatype
*/
public function testGetNotationDatatypeWithoutLabel() {
$vocab = $this->model->getVocabulary('test');
$concepts = $vocab->getConceptInfo('http://www.skosmos.skos/test/ta128', 'en');
$props = $concepts[0]->getProperties();
$propvals = $props['skos:notation']->getValues();
$this->assertEquals('', $propvals['testnotation']->getDatatype());
$this->assertNull($propvals['testnotation']->getDatatype());
}

/**
* @covers ConceptPropertyValueLiteral::getLabel
* @covers ConceptPropertyValueLiteral::getDatatype
*/
public function testGetLabelForDatatypeIfNull() {
$vocab = $this->model->getVocabulary('test');
Expand Down

0 comments on commit fbe2be0

Please sign in to comment.