Code Duplication    Length = 11-18 lines in 2 locations

src/OroCRM/Bundle/MagentoBundle/Tests/Unit/Provider/Reader/ContextReaderTest.php 1 location

@@ 107-124 (lines=18) @@
104
     * @expectedException \InvalidArgumentException
105
     * @expectedExceptionMessage Context key is missing
106
     */
107
    public function testReadFailed()
108
    {
109
        $reader = $this->getReader(null);
110
111
        /** @var \PHPUnit_Framework_MockObject_MockObject|StepExecution $stepExecution */
112
        $stepExecution = $this->getMockBuilder('Akeneo\Bundle\BatchBundle\Entity\StepExecution')
113
            ->disableOriginalConstructor()
114
            ->getMock();
115
116
        $context = $this->getMock('Oro\Bundle\ImportExportBundle\Context\ContextInterface');
117
118
        $this->contextRegistry->expects($this->once())
119
            ->method('getByStepExecution')
120
            ->with($stepExecution)
121
            ->will($this->returnValue($context));
122
123
        $reader->setStepExecution($stepExecution);
124
    }
125
}
126

src/OroCRM/Bundle/MagentoBundle/Tests/Unit/ImportExport/Writer/ProxyEntityWriterTest.php 1 location

@@ 119-129 (lines=11) @@
116
        ];
117
    }
118
119
    public function testSetStepExecutionSetToWrappedWriter()
120
    {
121
        $wrapped       = $this->getMock('OroCRM\Bundle\MagentoBundle\Tests\Unit\Stub\StepExecutionAwareWriter');
122
        $writer        = new ProxyEntityWriter($wrapped, $this->databaseHelper);
123
        $stepExecution = $this->getMockBuilder('Akeneo\Bundle\BatchBundle\Entity\StepExecution')
124
            ->disableOriginalConstructor()->getMock();
125
        $wrapped->expects($this->once())->method('setStepExecution')
126
            ->with($this->equalTo($stepExecution));
127
128
        $writer->setStepExecution($stepExecution);
129
    }
130
131
    public function testSetStepExecutionDoesNotProvokeErrorWithRegularWriter()
132
    {