public function testProcess()
 {
     $this->context->expects($this->never())->method('addFailureException');
     $converter = $this->getMockBuilder('Oro\\Bundle\\ImportExportBundle\\Converter\\DataConverterInterface')->setMethods(array('convertToImportFormat'))->getMockForAbstractClass();
     $converter->expects($this->once())->method('convertToImportFormat')->with($this->item)->will($this->returnArgument(0));
     $strategy = $this->getMockBuilder('Oro\\Bundle\\ImportExportBundle\\Strategy\\StrategyInterface')->setMethods(array('process'))->getMockForAbstractClass();
     $strategy->expects($this->once())->method('process')->with($this->object)->will($this->returnArgument(0));
     $this->processor->setDataConverter($converter);
     $this->processor->setStrategy($strategy);
     $this->assertEquals($this->object, $this->processor->process($this->item));
 }
예제 #2
0
 public function testSetEntityName()
 {
     $entityName = 'TestEntity';
     $dataConverter = $this->getMock('Oro\\Bundle\\ImportExportBundle\\Tests\\Unit\\Converter\\Stub\\EntityNameAwareDataConverter');
     $dataConverter->expects($this->once())->method('setEntityName')->with($entityName);
     $strategy = $this->getMock('Oro\\Bundle\\ImportExportBundle\\Tests\\Unit\\Strategy\\Stub\\EntityNameAwareStrategy');
     $strategy->expects($this->once())->method('setEntityName')->with($entityName);
     $this->processor->setDataConverter($dataConverter);
     $this->processor->setStrategy($strategy);
     $this->processor->setEntityName($entityName);
     $this->assertAttributeEquals($entityName, 'entityName', $this->processor);
 }