mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 10:23:17 +00:00
update ApiTestCase
This commit is contained in:
@@ -6,6 +6,7 @@ use Alchemy\Phrasea\Application;
|
|||||||
use Alchemy\Phrasea\Authentication\Context;
|
use Alchemy\Phrasea\Authentication\Context;
|
||||||
use Alchemy\Phrasea\Border\File;
|
use Alchemy\Phrasea\Border\File;
|
||||||
use Alchemy\Phrasea\Controller\Api\V1Controller;
|
use Alchemy\Phrasea\Controller\Api\V1Controller;
|
||||||
|
use Alchemy\Phrasea\ControllerProvider\Api\V1;
|
||||||
use Alchemy\Phrasea\ControllerProvider\Api\V2;
|
use Alchemy\Phrasea\ControllerProvider\Api\V2;
|
||||||
use Alchemy\Phrasea\Core\Configuration\PropertyAccess;
|
use Alchemy\Phrasea\Core\Configuration\PropertyAccess;
|
||||||
use Alchemy\Phrasea\Core\PhraseaEvents;
|
use Alchemy\Phrasea\Core\PhraseaEvents;
|
||||||
@@ -459,6 +460,10 @@ abstract class ApiTestCase extends \PhraseanetWebTestCase
|
|||||||
|
|
||||||
protected function evaluateMeta($content, $version = null)
|
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->assertTrue(is_array($content), 'La reponse est un objet');
|
||||||
$this->assertArrayHasKey('meta', $content);
|
$this->assertArrayHasKey('meta', $content);
|
||||||
$this->assertArrayHasKey('response', $content);
|
$this->assertArrayHasKey('response', $content);
|
||||||
|
|||||||
Reference in New Issue
Block a user