/** * Gets all labels of an Entity with the specified EntityId. * * @param EntityId $entityId * @param string[] $languageCodes * * @throws TermLookupException * @return string[] */ public function getLabels(EntityId $entityId, array $languageCodes) { try { return $this->entityInfo->getLabels($entityId, $languageCodes); } catch (OutOfBoundsException $ex) { throw new TermLookupException($entityId, $languageCodes, $ex->getMessage(), $ex); } }
/** * @dataProvider invalidArrayProvider */ public function testGetLabelsWithInvalidArray_throwsRuntimeException($array) { $info = new EntityInfo($array); $this->setExpectedException('RuntimeException'); $info->getLabels(new ItemId('Q99')); }