Completed
Push — develop ( 73bd0a...ccb498 )
by Tom
05:04
created

MakeHelperCommandTest::testOutput()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 13

Duplication

Lines 19
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 19
loc 19
rs 9.4285
cc 1
eloc 13
nc 1
nop 0
1
<?php
2
3
namespace N98\Magento\Command\Developer\Console;
4
5
6
use Magento\Framework\Filesystem\Directory\WriteInterface;
7
8 View Code Duplication
class MakeHelperCommandTest extends TestCase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
    /**
11
     * @test
12
     */
13
    public function testOutput()
14
    {
15
        $command = new MakeHelperCommand();
16
17
        $commandTester = $this->createCommandTester($command);
18
        $command->setCurrentModuleName('N98_Dummy');
19
20
        $writerMock = $this->getMock(WriteInterface::class);
21
        $writerMock
22
            ->expects($this->once())
23
            ->method('writeFile')
24
            ->with(
25
                $this->anything(), // param1
26
                $this->equalTo(file_get_contents(__DIR__ . '/_files/reference_helper.php'))
27
            );
28
29
        $command->setCurrentModuleDirectoryWriter($writerMock);
30
        $commandTester->execute(['classpath' => 'foo.bar.baz']);
31
    }
32
}