public function testIsVerbose() { $inputMock = $this->getMockBuilder('Symfony\\Component\\Console\\Input\\InputInterface')->getMock(); $outputMock = $this->getMockBuilder('Symfony\\Component\\Console\\Output\\Output')->setMethods(['getVerbosity', 'doWrite'])->getMock(); $outputMock->expects($this->at(0))->method('getVerbosity')->will($this->returnValue(2)); $outputMock->expects($this->at(1))->method('getVerbosity')->will($this->returnValue(0)); $helperMock = $this->getMockBuilder('Symfony\\Component\\Console\\Helper\\HelperSet')->getMock(); $consoleIO = new ConsoleIO($inputMock, $outputMock, $helperMock); $this->assertTrue($consoleIO->isVerbose()); $this->assertFalse($consoleIO->isVerbose()); }
public function testIsVerbose() { $isVerbose = true; $this->command->setCode(function (InputInterface $input, OutputInterface $output) use(&$isVerbose) { $io = new ConsoleIO($input, $output); $this->assertEquals($isVerbose, $io->isVerbose()); }); $this->tester->execute([], ['verbosity' => 2]); $isVerbose = false; $this->tester->execute([], ['verbosity' => 0]); }