Skip to content

Commit

Permalink
adding a few tests for getLanguageOrder(), related to #688
Browse files Browse the repository at this point in the history
  • Loading branch information
Henri Ylikotila committed Jan 22, 2018
1 parent 548ef9e commit 902e9be
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/VocabularyConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,4 +362,21 @@ public function testGetTypesWhenNotSet() {
$vocab = $this->model->getVocabulary('testdiff');
$this->assertEquals(array(), $vocab->getConfig()->getTypes('en'));
}

/**
* @covers VocabularyConfig::getLanguageOrder
*/
public function testGetLanguageOrderNotSet() {
$vocab = $this->model->getVocabulary('test');
$this->assertEquals(array('en'), $vocab->getConfig()->getLanguageOrder('en'));
}

/**
* @covers VocabularyConfig::getLanguageOrder
*/
public function testGetLanguageOrder() {
$vocab = $this->model->getVocabulary('subtag');
$this->assertEquals(array('en', 'fr', 'de', 'sv'), $vocab->getConfig()->getLanguageOrder('en'));
$this->assertEquals(array('fi', 'fr', 'de', 'sv', 'en'), $vocab->getConfig()->getLanguageOrder('fi'));
}
}
1 change: 1 addition & 0 deletions tests/testvocabularies.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@
void:uriSpace "http://www.skosmos.skos/subtag/";
void:sparqlEndpoint <http://localhost:3030/ds/sparql> ;
skosmos:language "en";
skosmos:fallbackLanguages ( "fr" "de" "sv" ) ;
skosmos:sparqlGraph <http://www.skosmos.skos/subtag/> ;
skosmos:sparqlDialect "JenaText" .

Expand Down

0 comments on commit 902e9be

Please sign in to comment.