/** * @covers \Migration\Step\SalesOrder\InitialData::initDestAttributes * @covers \Migration\Step\SalesOrder\InitialData::getDestEavAttributesCount * @return void */ public function testInit() { $eavEntityDocument = 'eav_entity_int'; $this->helper->expects($this->once())->method('getDestEavDocument')->willReturn($eavEntityDocument); $this->destination->expects($this->once())->method('getRecordsCount')->willReturn(2); $this->initialData->init(); $this->assertEquals($this->initialData->getDestEavAttributesCount($eavEntityDocument), 2); }
/** * @return void */ protected function checkEavEntities() { $countBeforeRun = $this->initialData->getDestEavAttributesCount($this->helper->getDestEavDocument()); $countAfterRun = $this->destination->getRecordsCount($this->helper->getDestEavDocument()); $countEavAttributes = null; foreach ($this->helper->getEavAttributes() as $eavAttribute) { $countEavAttributes += count($this->helper->getSourceAttributes($eavAttribute)); } if ($countBeforeRun + $countEavAttributes != $countAfterRun) { $this->errors[] = sprintf('Mismatch of entities in the document: %s', $this->helper->getDestEavDocument()); } }