Fix tests

This commit is contained in:
Piotr Antosik 2019-11-21 11:41:06 +01:00
parent dc1f11a46f
commit e8d4afd1af
No known key found for this signature in database
GPG Key ID: 2E11207C8063A962

View File

@ -25,7 +25,13 @@ class ControllersTest extends TestCase
*/
public function testSwaggerUiControllerInstanciation()
{
$controller = new SwaggerUiController(new ApiDocGenerator([], []), $this->createMock('Twig_Environment'));
if (class_exists('Twig_Environment')) {
$twigMock = $this->createMock('Twig_Environment');
} else {
$twigMock = $this->createMock('Twig\Environment');
}
$controller = new SwaggerUiController(new ApiDocGenerator([], []), $twigMock);
$controller(new Request());
}