Fix bad mock in XSendFileMappingGeneratorTest

This commit is contained in:
Benoît Burnichon
2015-10-28 19:09:58 +01:00
parent 6388e8bdb0
commit c1943cc0fb

View File

@@ -41,21 +41,17 @@ class XSendFileMappingGeneratorTest extends \PhraseanetTestCase
$conf->expects($this->any()) $conf->expects($this->any())
->method('get') ->method('get')
->will($this->returnCallback(function ($property, $defaultValue = null) use ($originalConf) { ->will($this->returnCallback(function ($property, $defaultValue = null) use ($originalConf) {
switch ($property) { return $originalConf->get($property, $defaultValue);
case ['main', 'database']:
return $originalConf->get($property);
default:
return $defaultValue;
}
})); }));
self::$DI['cli']['conf'] = $conf; self::$DI['cli']['conf'] = $conf;
if ($option) { if ($option) {
self::$DI['cli']['conf']->expects($this->once()) $conf->expects($this->once())
->method('set') ->method('set')
->with('xsendfile'); ->with('xsendfile');
} else { } else {
self::$DI['cli']['conf']->expects($this->never()) $conf->expects($this->never())
->method('set'); ->method('set');
} }
$command->setContainer(self::$DI['cli']); $command->setContainer(self::$DI['cli']);