/** * @param Fingerprint $fingerprint * @param EntityDiff $patch * * @throws InvalidArgumentException */ public function patchFingerprint(Fingerprint $fingerprint, EntityDiff $patch) { $labels = $this->patcher->patch($fingerprint->getLabels()->toTextArray(), $patch->getLabelsDiff()); $fingerprint->setLabels($this->newTermListFromArray($labels)); $descriptions = $this->patcher->patch($fingerprint->getDescriptions()->toTextArray(), $patch->getDescriptionsDiff()); $fingerprint->setDescriptions($this->newTermListFromArray($descriptions)); $this->patchAliases($fingerprint, $patch->getAliasesDiff()); }
public function testSetLabels() { $fingerprint = new Fingerprint(); $fingerprint->setLabel('en', 'foo'); $labels = new TermList(array(new Term('de', 'bar'))); $fingerprint->setLabels($labels); $this->assertEquals($labels, $fingerprint->getLabels()); }