1 | <?php |
||
11 | class DefaultSiteGeneratorTest extends TestCase |
||
12 | { |
||
13 | public function testGenerator() |
||
14 | { |
||
15 | $filesystem = new Filesystem(); |
||
16 | $path = sys_get_temp_dir() . '/' . uniqid(); |
||
17 | $filesystem->remove($path); |
||
18 | |||
19 | $bundle = $this->getBundle($path); |
||
20 | $container = $this->createMock('Symfony\Component\DependencyInjection\Container'); |
||
21 | $container |
||
22 | ->expects($this->atLeastOnce()) |
||
23 | ->method('getParameter') |
||
24 | ->will($this->returnValueMap([['multilanguage', true], ['kernel.project_dir', $path]])) |
||
25 | ; |
||
26 | $container |
||
27 | ->expects($this->once()) |
||
28 | ->method('hasParameter') |
||
29 | ->with('kunstmaan_admin.multi_language') |
||
30 | ->will($this->returnValue(true)) |
||
31 | ; |
||
32 | |||
33 | $generator = new DefaultSiteGenerator($filesystem, $this->getRegistry(), '/defaultsite', $this->getAssistant(), $container); |
||
34 | $generator->generate($bundle, '', __DIR__ . '/../../_data', false); |
||
35 | |||
36 | $basePath = Kernel::VERSION_ID >= 40000 ? 'templates/bundles/TwigBundle/' : 'app/Resources/TwigBundle/views/'; |
||
37 | unlink(__DIR__ . '/../../_data/' . $basePath . 'Exception/error.html.twig'); |
||
38 | unlink(__DIR__ . '/../../_data/' . $basePath . 'Exception/error404.html.twig'); |
||
39 | unlink(__DIR__ . '/../../_data/' . $basePath . 'Exception/error500.html.twig'); |
||
40 | unlink(__DIR__ . '/../../_data/' . $basePath . 'Exception/error503.html.twig'); |
||
41 | } |
||
42 | |||
43 | protected function getBundle($path) |
||
66 | |||
67 | protected function getRegistry() |
||
73 | |||
74 | protected function getAssistant() |
||
83 | } |
||
84 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: