From c9be91b13ce93a3cb513c17667ea4cb2ec1cd997 Mon Sep 17 00:00:00 2001 From: Osma Suominen Date: Thu, 31 Aug 2023 14:12:04 +0300 Subject: [PATCH] fix implementation of ConceptPropertyValue.getLang + add test --- src/model/ConceptPropertyValue.php | 2 +- tests/ConceptPropertyValueTest.php | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/model/ConceptPropertyValue.php b/src/model/ConceptPropertyValue.php index 5aabc3258..c4735fa89 100644 --- a/src/model/ConceptPropertyValue.php +++ b/src/model/ConceptPropertyValue.php @@ -38,7 +38,7 @@ public function __toString() public function getLang() { - return $this->getLang(); + return $this->model->getLocale(); } public function getLabel($lang = '', $fallbackToUri = 'uri') diff --git a/tests/ConceptPropertyValueTest.php b/tests/ConceptPropertyValueTest.php index 020dd33cd..9155ace9b 100644 --- a/tests/ConceptPropertyValueTest.php +++ b/tests/ConceptPropertyValueTest.php @@ -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 */