public function testOutputWatcher() { $output = $this->getMock('Symfony\\Component\\Console\\Output\\OutputInterface'); $output->expects($this->any())->method('write'); $output->expects($this->once())->method('setVerbosity'); $output->expects($this->once())->method('getVerbosity')->will($this->returnValue(OutputInterface::VERBOSITY_NORMAL)); $output->expects($this->once())->method('setDecorated'); $output->expects($this->once())->method('isDecorated'); $output->expects($this->once())->method('setFormatter'); $output->expects($this->once())->method('getFormatter'); $ow = new OutputWatcher($output); $ow->write('test'); $this->assertTrue($ow->getWasWritten()); $ow->writeln('test'); $ow->setVerbosity(OutputInterface::VERBOSITY_NORMAL); $this->assertEquals(OutputInterface::VERBOSITY_NORMAL, $ow->getVerbosity()); $ow->setDecorated(true); $ow->isDecorated(); $ow->setFormatter($this->getMock('Symfony\\Component\\Console\\Formatter\\OutputFormatterInterface')); $ow->getFormatter(); $ow->setWasWritten(false); $this->assertFalse($ow->getWasWritten()); }
/** * @param string $serverName */ public function endOnServer($serverName) { if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) { $this->output->writeln("<info>•</info> done on [{$serverName}]"); } }