isInteractive() публичный Метод

public isInteractive ( )
Пример #1
0
 public function testIsInteractive()
 {
     $inputMock = $this->getMockBuilder('Symfony\\Component\\Console\\Input\\InputInterface')->getMock();
     $inputMock->expects($this->at(0))->method('isInteractive')->will($this->returnValue(true));
     $inputMock->expects($this->at(1))->method('isInteractive')->will($this->returnValue(false));
     $outputMock = $this->getMockBuilder('Symfony\\Component\\Console\\Output\\OutputInterface')->getMock();
     $helperMock = $this->getMock('Symfony\\Component\\Console\\Helper\\HelperSet');
     $consoleIO = new ConsoleIO($inputMock, $outputMock, $helperMock);
     $this->assertTrue($consoleIO->isInteractive());
     $this->assertFalse($consoleIO->isInteractive());
 }
Пример #2
0
 public function testIsInteractive()
 {
     $isInteractive = false;
     $this->command->setCode(function (InputInterface $input, OutputInterface $output) use(&$isInteractive) {
         $io = new ConsoleIO($input, $output);
         $this->assertEquals($isInteractive, $io->isInteractive());
     });
     $this->tester->execute([], ['interactive' => false]);
     $isInteractive = true;
     $this->tester->execute([], ['interactive' => true]);
 }