/** * @dataProvider dataValueDataProvider */ public function testAddDataValues($dataValues, $expected) { $title = Title::newFromText(__METHOD__); $instance = new SemanticData(DIWikiPage::newFromTitle($title)); foreach ($dataValues as $dataValue) { $instance->addDataValue($dataValue); } if ($expected['error'] > 0) { return $this->assertCount($expected['error'], $instance->getErrors()); } $this->semanticDataValidator->assertThatPropertiesAreSet($expected, $instance); }
/** * @see SemanticData::addDataValue * * @since 1.9 * * @param SMWDataValue $dataValue */ public function addDataValue(DataValue $dataValue) { $this->semanticData->addDataValue($dataValue); $this->addError($this->semanticData->getErrors()); }