Skip to content

Commit

Permalink
Merge pull request #1507 from NatLibFi/fix-conceptpropertyvalue-getlang
Browse files Browse the repository at this point in the history
fix implementation of ConceptPropertyValue.getLang + add test
  • Loading branch information
osma authored Aug 31, 2023
2 parents 76def2f + c9be91b commit 0188425
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/model/ConceptPropertyValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __toString()

public function getLang()
{
return $this->getLang();
return $this->model->getLocale();
}

public function getLabel($lang = '', $fallbackToUri = 'uri')
Expand Down
10 changes: 10 additions & 0 deletions tests/ConceptPropertyValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ public function testConstructor()
$this->assertInstanceOf('ConceptPropertyValue', $propval);
}

/**
* @covers ConceptPropertyValue::getLang
*/
public function testGetLang()
{
$props = $this->concept->getProperties();
$propvals = $props['skos:narrower']->getValues();
$this->assertEquals('en', $propvals['Crucian carp http://www.skosmos.skos/test/ta121']->getLang());
}

/**
* @covers ConceptPropertyValue::getLabel
*/
Expand Down

0 comments on commit 0188425

Please sign in to comment.