From e8d4afd1affa52282cebec1651bbd18f55af7985 Mon Sep 17 00:00:00 2001 From: Piotr Antosik Date: Thu, 21 Nov 2019 11:41:06 +0100 Subject: [PATCH] Fix tests --- Tests/Controller/ControllersTest.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Tests/Controller/ControllersTest.php b/Tests/Controller/ControllersTest.php index d94f57d..3c83e0d 100644 --- a/Tests/Controller/ControllersTest.php +++ b/Tests/Controller/ControllersTest.php @@ -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()); }