mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Restart with xdebug disabled
This commit is contained in:
parent
034f1cf591
commit
586eb3bb41
4 changed files with 377 additions and 0 deletions
56
tests/Composer/Test/XdebugHandlerTest.php
Normal file
56
tests/Composer/Test/XdebugHandlerTest.php
Normal file
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer\Test;
|
||||
|
||||
use Composer\Test\Mock\XdebugHandlerMock as XdebugHandler;
|
||||
|
||||
/**
|
||||
* @author John Stevenson <john-stevenson@blueyonder.co.uk>
|
||||
*/
|
||||
class XdebugHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $argv;
|
||||
|
||||
public function setup()
|
||||
{
|
||||
$this->argv = $GLOBALS['argv'];
|
||||
}
|
||||
|
||||
public function testRestartWhenLoaded()
|
||||
{
|
||||
$loaded = true;
|
||||
|
||||
$xdebug = new XdebugHandler($this->argv, $loaded);
|
||||
$xdebug->check();
|
||||
$this->assertTrue($xdebug->restarted || !defined('PHP_BINARY'));
|
||||
}
|
||||
|
||||
public function testNoRestartWhenNotLoaded()
|
||||
{
|
||||
$loaded = false;
|
||||
|
||||
$xdebug = new XdebugHandler($this->argv, $loaded);
|
||||
$xdebug->check();
|
||||
$this->assertFalse($xdebug->restarted);
|
||||
}
|
||||
|
||||
public function testNoRestartWhenLoadedAndAllowed()
|
||||
{
|
||||
$loaded = true;
|
||||
putenv(XdebugHandler::ENV_ALLOW.'=1');
|
||||
|
||||
$xdebug = new XdebugHandler($this->argv, $loaded);
|
||||
$xdebug->check();
|
||||
$this->assertFalse($xdebug->restarted);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue