From 860d6c90288b6118e7517428306b17bd8c7a1616 Mon Sep 17 00:00:00 2001 From: aina-esokia Date: Fri, 6 Jul 2018 16:01:23 +0400 Subject: [PATCH] update ApiTestCase --- tests/Alchemy/Tests/Phrasea/Controller/Api/ApiTestCase.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Api/ApiTestCase.php b/tests/Alchemy/Tests/Phrasea/Controller/Api/ApiTestCase.php index 3b10c5266f..13d77f7c9a 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Api/ApiTestCase.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Api/ApiTestCase.php @@ -6,6 +6,7 @@ use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Authentication\Context; use Alchemy\Phrasea\Border\File; use Alchemy\Phrasea\Controller\Api\V1Controller; +use Alchemy\Phrasea\ControllerProvider\Api\V1; use Alchemy\Phrasea\ControllerProvider\Api\V2; use Alchemy\Phrasea\Core\Configuration\PropertyAccess; use Alchemy\Phrasea\Core\PhraseaEvents; @@ -459,6 +460,10 @@ abstract class ApiTestCase extends \PhraseanetWebTestCase protected function evaluateMeta($content, $version = null) { + if(mb_strpos($content['meta']['request'], '/api/v1') !== FALSE){ + $version = V1::VERSION; + } + $this->assertTrue(is_array($content), 'La reponse est un objet'); $this->assertArrayHasKey('meta', $content); $this->assertArrayHasKey('response', $content);