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

MakeControllerCommandTest::testOutput()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 14

Duplication

Lines 22
Ratio 100 %

Importance

Changes 2
Bugs 0 Features 2
Metric Value
c 2
b 0
f 2
dl 22
loc 22
rs 9.2
cc 1
eloc 14
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 MakeControllerCommandTest 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 MakeControllerCommand();
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_controller.php'))
27
            );
28
29
        $command->setCurrentModuleDirectoryWriter($writerMock);
30
31
        $commandTester->execute([
32
            'classpath' => 'foo.bar.baz',
33
        ]);
34
    }
35
}