minor #33824 [WebProfilerBundle] Fix TemplateManager test (fancyweb)
This PR was merged into the 5.0-dev branch.
Discussion
----------
[WebProfilerBundle] Fix TemplateManager test
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Commits
-------
d1ed9685e1
[WebProfilerBundle] Fix TemplateManager test
This commit is contained in:
commit
35f319caeb
@ -16,7 +16,6 @@ use Symfony\Bundle\WebProfilerBundle\Tests\TestCase;
|
||||
use Symfony\Component\HttpKernel\Profiler\Profile;
|
||||
use Twig\Environment;
|
||||
use Twig\Loader\LoaderInterface;
|
||||
use Twig\Loader\SourceContextLoaderInterface;
|
||||
|
||||
/**
|
||||
* Test for TemplateManager class.
|
||||
@ -103,11 +102,14 @@ class TemplateManagerTest extends TestCase
|
||||
|
||||
protected function mockTwigEnvironment()
|
||||
{
|
||||
$loader = $this->getMockBuilder('Twig\Loader\LoaderInterface')->getMock();
|
||||
$loader->method('getSourceContext')->willReturn(new Source('source-code', 'source-name'));
|
||||
$loader->method('exists')->willReturn(true);
|
||||
|
||||
$this->twigEnvironment = $this->getMockBuilder('Twig\Environment')->disableOriginalConstructor()->getMock();
|
||||
|
||||
$loader = $this->createMock(LoaderInterface::class);
|
||||
$loader
|
||||
->expects($this->any())
|
||||
->method('exists')
|
||||
->willReturn(true);
|
||||
|
||||
$this->twigEnvironment->expects($this->any())->method('getLoader')->willReturn($loader);
|
||||
|
||||
return $this->twigEnvironment;
|
||||
@ -130,7 +132,7 @@ class ProfileDummy extends Profile
|
||||
parent::__construct('token');
|
||||
}
|
||||
|
||||
public function hasCollector($name): bool
|
||||
public function hasCollector(string $name): bool
|
||||
{
|
||||
switch ($name) {
|
||||
case 'foo':
|
||||
|
Reference in New Issue
Block a user