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(); }
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(); }