/** * Gets the label of an Entity with the specified EntityId and language code. * * @param EntityId $entityId * @param string $languageCode * * @throws TermLookupException * @return string|null */ public function getLabel(EntityId $entityId, $languageCode) { try { return $this->entityInfo->getLabel($entityId, $languageCode); } catch (OutOfBoundsException $ex) { throw new TermLookupException($entityId, array($languageCode), $ex->getMessage(), $ex); } }
/** * @dataProvider invalidArrayProvider */ public function testGetLabelWithInvalidArray_throwsRuntimeException($array) { $info = new EntityInfo($array); $this->setExpectedException('RuntimeException'); $info->getLabel(new ItemId('Q99'), 'en'); }