isTerminal() public method

public isTerminal ( )
Example #1
0
 public function testIsTerminalWhenForceTerminalWasUsedBeforeFirstCallToConstructor()
 {
     $this->if(\mageekguy\atoum\cli::forceTerminal())->and($adapter = new atoum\test\adapter())->and($adapter->defined = function ($constant) {
         switch ($constant) {
             case 'PHP_WINDOWS_VERSION_BUILD':
                 return false;
             case 'STDOUT':
                 return false;
         }
     })->and($cli = new atoum\cli($adapter))->then->boolean($cli->isTerminal())->isTrue()->if($otherCli = new atoum\cli())->then->boolean($otherCli->isTerminal())->isTrue();
 }
Example #2
0
 public function testIsTerminalWhenForceTerminalAfterConstruction()
 {
     $this->if($adapter = new atoum\test\adapter())->and($adapter->defined = function ($constant) {
         switch ($constant) {
             case 'STDOUT':
                 return false;
         }
     })->and($cli = new atoum\cli($adapter))->then->boolean($cli->isTerminal())->isFalse()->if($otherCli = new atoum\cli($adapter))->then->boolean($otherCli->isTerminal())->isFalse()->if(atoum\cli::forceTerminal())->then->boolean($cli->isTerminal())->isTrue()->boolean($otherCli->isTerminal())->isTrue();
 }