| Conditions | 1 |
| Paths | 1 |
| Total Lines | 35 |
| Code Lines | 25 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | public function testWrite() |
||
| 13 | { |
||
| 14 | $data = array( |
||
| 15 | array( |
||
| 16 | 'first' => 'The first', |
||
| 17 | 'second' => 'Second property' |
||
| 18 | ), array( |
||
| 19 | 'first' => 'Another first', |
||
| 20 | 'second' => 'Last second' |
||
| 21 | ) |
||
| 22 | ); |
||
| 23 | $reader = new ArrayReader($data); |
||
| 24 | |||
| 25 | $output = $this->getMockBuilder('Symfony\Component\Console\Output\OutputInterface') |
||
| 26 | ->getMock(); |
||
| 27 | |||
| 28 | $outputFormatter = $this->getMock('Symfony\Component\Console\Formatter\OutputFormatterInterface'); |
||
| 29 | $output->expects($this->once()) |
||
| 30 | ->method('isDecorated') |
||
| 31 | ->will($this->returnValue(true)); |
||
| 32 | |||
| 33 | $output->expects($this->atLeastOnce()) |
||
| 34 | ->method('getFormatter') |
||
| 35 | ->will($this->returnValue($outputFormatter)); |
||
| 36 | |||
| 37 | $output->expects($this->atLeastOnce()) |
||
| 38 | ->method('write'); |
||
| 39 | $writer = new ConsoleProgressWriter($output, $reader); |
||
| 40 | |||
| 41 | $workflow = new StepAggregator($reader); |
||
| 42 | $workflow->addWriter($writer) |
||
| 43 | ->process(); |
||
| 44 | |||
| 45 | $this->assertEquals('debug', $writer->getVerbosity()); |
||
| 46 | } |
||
| 47 | } |
||
| 48 |