public function shouldCreateAndCloneNewRepoWhenDoesNotExist()
{
$bundle = new BundleEntity();
$bundle->setOwnerName('KnpLabs');
$bundle->setName('KnpBundles');
$expectedDir = $this->getExpectedDir();
$repoManager = $this->getRepoManager();
$repoManager->expects($this->once())->method('cloneRepo')->with($this->equalTo('git://github.com/KnpLabs/KnpBundles.git'), $this->equalTo($expectedDir))->will($this->returnValue($this->getPhpGitRepository()));
$this->assertFalse(is_dir($expectedDir));
$this->assertInstanceOf('Knp\\Bundle\\KnpBundlesBundle\\Git\\Repo', $repoManager->getRepo($bundle));
$this->assertTrue(is_dir($expectedDir));
}