Conditions | 1 |
Paths | 1 |
Total Lines | 29 |
Code Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 2 |
1 | <?php |
||
14 | public function testOutput() |
||
15 | { |
||
16 | $diFileWriterMock = $this->getMockBuilder(DiFileWriter::class) |
||
17 | ->setMethods(['save']) |
||
18 | ->getMock(); |
||
19 | $diFileWriterMock->loadXml('<config />'); |
||
20 | |||
21 | |||
22 | $command = $this->getMock(MakeCommandCommand::class, ['createDiFileWriter']); |
||
23 | $command |
||
24 | ->expects($this->once()) |
||
25 | ->method('createDiFileWriter') |
||
26 | ->will($this->returnValue($diFileWriterMock)); |
||
27 | |||
28 | $commandTester = $this->createCommandTester($command); |
||
29 | $command->setCurrentModuleName('N98_Dummy'); |
||
30 | |||
31 | $writerMock = $this->getMock(WriteInterface::class); |
||
32 | $writerMock |
||
33 | ->expects($this->once()) |
||
34 | ->method('writeFile') |
||
35 | ->with( |
||
36 | $this->anything(), // param 1 |
||
37 | $this->equalTo(file_get_contents(__DIR__ . '/_files/reference_command.php')) |
||
38 | ); |
||
39 | |||
40 | $command->setCurrentModuleDirectoryWriter($writerMock); |
||
41 | $commandTester->execute(['classpath' => 'foo.bar.baz']); |
||
42 | } |
||
43 | } |