Exemple #1
0
 /**
  * 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;
 }
 /**
  * @dataProvider validateStructureDataProvider
  *
  * @param bool $result
  * @param \Migration\Resource\Structure|null $structure
  */
 public function testValidateStructure($result, $structure)
 {
     $this->record->setStructure(null);
     $this->assertEquals($result, $this->record->validateStructure($structure));
 }