|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* @author Gerard van Helden <[email protected]> |
|
4
|
|
|
* @copyright Zicht Online <http://zicht.nl> |
|
5
|
|
|
*/ |
|
6
|
|
|
|
|
7
|
|
|
namespace Zicht\Bundle\PageBundle\Test\Integration; |
|
8
|
|
|
|
|
9
|
|
|
use Symfony\Component\HttpFoundation\Request; |
|
10
|
|
|
use Symfony\Component\HttpKernel\Event\GetResponseEvent; |
|
11
|
|
|
use Symfony\Component\HttpKernel\HttpKernelInterface; |
|
12
|
|
|
use Symfony\Component\HttpKernel\KernelEvents; |
|
13
|
|
|
use Zicht\Bundle\PageBundle\Controller\PageController; |
|
14
|
|
|
use Zicht\Bundle\PageBundle\Manager\PageManager; |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* Class AbstractPageTest |
|
18
|
|
|
* |
|
19
|
|
|
* @package Zicht\Bundle\PageBundle\Test\Integration |
|
20
|
|
|
*/ |
|
21
|
|
|
abstract class AbstractPageTest extends \PHPUnit_Framework_TestCase |
|
22
|
|
|
{ |
|
23
|
|
|
/** |
|
24
|
|
|
* @var \AppKernel |
|
|
|
|
|
|
25
|
|
|
*/ |
|
26
|
|
|
public $kernel; |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* @{inheritDoc} |
|
30
|
|
|
*/ |
|
31
|
|
|
public function setUp() |
|
32
|
|
|
{ |
|
33
|
|
|
$this->kernel = new \AppKernel(); |
|
34
|
|
|
$this->kernel->boot(); |
|
35
|
|
|
|
|
36
|
|
|
// we need to synthesize the request, because it could be used by the controller or it's templates. |
|
37
|
|
|
$request = new Request(); |
|
38
|
|
|
|
|
39
|
|
|
$this->kernel->getContainer()->get('event_dispatcher')->dispatch( |
|
40
|
|
|
KernelEvents::REQUEST, |
|
41
|
|
|
new GetResponseEvent($this->kernel, $request, HttpKernelInterface::MASTER_REQUEST) |
|
42
|
|
|
); |
|
43
|
|
|
$this->kernel->getContainer()->enterScope('request'); |
|
44
|
|
|
$this->kernel->getContainer()->set('request', $request, 'request'); |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
/** |
|
48
|
|
|
* Creates page manager |
|
49
|
|
|
* |
|
50
|
|
|
* @return PageManager |
|
51
|
|
|
*/ |
|
52
|
|
|
protected function createPageManager() |
|
53
|
|
|
{ |
|
54
|
|
|
$kernel = new \AppKernel(); |
|
55
|
|
|
$kernel->boot(); |
|
56
|
|
|
|
|
57
|
|
|
$pageManager = $kernel->getContainer()->get('zicht_page.page_manager'); |
|
58
|
|
|
return $pageManager; |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
/** |
|
62
|
|
|
* Creates page controller |
|
63
|
|
|
* |
|
64
|
|
|
* @return PageController |
|
65
|
|
|
*/ |
|
66
|
|
|
protected function createPageController() |
|
67
|
|
|
{ |
|
68
|
|
|
$pageController = new PageController(); |
|
69
|
|
|
$pageController->setContainer($this->kernel->getContainer()); |
|
70
|
|
|
return $pageController; |
|
71
|
|
|
} |
|
72
|
|
|
} |
|
73
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths