private function mockLoader() { $loader = $this->getMock('Contao\\CoreBundle\\Config\\Loader\\PhpFileLoader', ['load']); $loader->expects($this->once())->method('load')->with('test.php', null)->willReturn("\necho 'test';\n"); return $loader; }