|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of the Symfony-Util package. |
|
5
|
|
|
* |
|
6
|
|
|
* (c) Jean-Bernard Addor |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
9
|
|
|
* file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
use PHPUnit\Framework\TestCase; |
|
13
|
|
|
use Symfony\Bridge\Twig\TwigEngine; |
|
14
|
|
|
use Symfony\Component\HttpFoundation\Request; |
|
15
|
|
|
use Symfony\Component\HttpFoundation\Response; |
|
16
|
|
|
use Symfony\Component\Templating\TemplateNameParser; |
|
17
|
|
|
use SymfonyUtil\Controller\EngineAsArgumentController; |
|
18
|
|
|
|
|
19
|
|
|
/** |
|
20
|
|
|
* @covers \SymfonyUtil\Controller\EngineAsArgumentController |
|
21
|
|
|
*/ |
|
22
|
|
|
final class EngineAsArgumentInKernelControllerTest extends TestCase |
|
|
|
|
|
|
23
|
|
|
{ |
|
24
|
|
|
public function testCanBeCreated() |
|
25
|
|
|
{ |
|
26
|
|
|
$this->assertInstanceOf( |
|
27
|
|
|
// ...::class, // 5.4 < php |
|
|
|
|
|
|
28
|
|
|
'Symfony\Component\HttpKernel\Kernel', |
|
29
|
|
|
new AppKernel('dev', true) |
|
30
|
|
|
); |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
|
|
public function testKernelInterface() |
|
34
|
|
|
{ |
|
35
|
|
|
$this->assertInstanceOf( |
|
36
|
|
|
// ...::class, // 5.4 < php |
|
|
|
|
|
|
37
|
|
|
'Symfony\Component\HttpKernel\KernelInterface', |
|
38
|
|
|
new AppKernel('dev', true) |
|
39
|
|
|
); |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
public function testReturnsResponse() |
|
43
|
|
|
{ |
|
44
|
|
|
$this->assertInstanceOf( |
|
45
|
|
|
// Response::class, // 5.4 < php |
|
46
|
|
|
'Symfony\Component\HttpFoundation\Response', |
|
47
|
|
|
(new AppKernel('dev', true))->handle(Request::create('/', 'GET')) |
|
48
|
|
|
); |
|
49
|
|
|
} |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
// http://api.symfony.com/3.3/Symfony/Bridge/Twig/TwigEngine.html |
|
53
|
|
|
// http://api.symfony.com/3.3/Symfony/Bundle/TwigBundle/TwigEngine.html |
|
54
|
|
|
|
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.