protected function mockConfigAdapter($minPasswordLength = null)
{
$configAdapter = $this->getMockBuilder('Contao\\CoreBundle\\Framework\\Adapter')->setMethods(['isComplete', 'preload', 'getInstance', 'get'])->disableOriginalConstructor()->getMock();
$configAdapter->expects($this->any())->method('isComplete')->willReturn(true);
$configAdapter->expects($this->any())->method('preload')->willReturn(null);
$configAdapter->expects($this->any())->method('getInstance')->willReturn(null);
$configAdapter->expects($this->any())->method('get')->willReturnCallback(function ($key) use($minPasswordLength) {
switch ($key) {
case 'characterSet':
return 'UTF-8';
case 'timeZone':
return 'Europe/Berlin';
case 'gdMaxImgWidth':
case 'gdMaxImgHeight':
return 3000;
case 'minPasswordLength':
return $minPasswordLength;
default:
return null;
}
});
return $configAdapter;
}