/** * Add Record to collection * * @param \Migration\Resource\Record $record * @return $this * @throws Exception */ public function addRecord($record) { if (!$record->getStructure()) { $record->setStructure($this->structure); } if (!$record->validateStructure($this->structure)) { throw new Exception("Record structure does not equal Collection structure"); } $this->data[] = $record; return $this; }
/** * @covers \Migration\Resource\Record::getStructure * @covers \Migration\Resource\Record::setStructure */ public function testGetStructure() { $this->record->setStructure($this->structure); $this->assertSame($this->structure, $this->record->getStructure()); }