/** @test */ public function it_fails_validation() { $rawData = ['wrong' => 'data']; $creator = new Creator($rawData); $validator = new EntryInfoValidator($creator); $this->assertFalse($validator->validate()); }
/** * Add additional entry info (location, creator). * * @param EntryInfo $info * @return Entry * @throws InvalidEntryParamStructure */ public function addInfo(EntryInfo $info) { $validator = new EntryInfoValidator($info); if (!$validator->validate()) { $message = implode(', ', $validator->getErrors()); throw new InvalidEntryParamStructure($message); } $info->save($this->data); return $this; }