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

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