isDecorated() public method

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