1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Fixing bug not cleaning up workspaces.

This commit is contained in:
Clark Stuth 2014-03-18 14:39:47 -05:00
parent 492539101c
commit c11105dd60
4 changed files with 52 additions and 4 deletions

View file

@ -93,7 +93,7 @@ class PerforceDriverTest extends \PHPUnit_Framework_TestCase
protected function getMockPerforce()
{
$methods = array('p4login', 'checkStream', 'writeP4ClientSpec', 'connectClient', 'getComposerInformation');
$methods = array('p4login', 'checkStream', 'writeP4ClientSpec', 'connectClient', 'getComposerInformation', 'cleanupClientSpec');
return $this->getMockBuilder('Composer\Util\Perforce', $methods)->disableOriginalConstructor()->getMock();
}
@ -159,4 +159,13 @@ class PerforceDriverTest extends \PHPUnit_Framework_TestCase
$this->expectOutputString('');
$this->assertFalse(PerforceDriver::supports($this->io, $this->config, 'existing.url'));
}
public function testCleanup()
{
$this->perforce->expects($this->once())->method('cleanupClientSpec');
$this->driver->setPerforce($this->perforce);
$this->driver->cleanup();
$this->assertNull($this->driver->getPerforce());
}
}