mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 10:23:17 +00:00
Remove client dependency in test, use $this->request instead
This commit is contained in:
@@ -841,17 +841,15 @@ class ApiJsonTest extends ApiTestCase
|
|||||||
|
|
||||||
self::$DI['record_story_1'];
|
self::$DI['record_story_1'];
|
||||||
|
|
||||||
$client = $this->getClient();
|
$response = $this->request(
|
||||||
$client->request(
|
|
||||||
'POST',
|
'POST',
|
||||||
'/api/v1/search/',
|
'/api/v1/search/',
|
||||||
$this->getParameters(['search_type' => SearchEngineOptions::RECORD_GROUPING]),
|
$this->getParameters(['search_type' => SearchEngineOptions::RECORD_GROUPING]),
|
||||||
[],
|
|
||||||
['HTTP_Accept' => $this->getAcceptMimeType()]
|
['HTTP_Accept' => $this->getAcceptMimeType()]
|
||||||
);
|
);
|
||||||
$content = $this->unserialize($client->getResponse()->getContent());
|
$content = $this->unserialize($response->getContent());
|
||||||
|
|
||||||
$this->evaluateResponse200($client->getResponse());
|
$this->evaluateResponse200($response);
|
||||||
$this->evaluateMeta200($content);
|
$this->evaluateMeta200($content);
|
||||||
|
|
||||||
$response = $content['response'];
|
$response = $content['response'];
|
||||||
@@ -877,10 +875,10 @@ class ApiJsonTest extends ApiTestCase
|
|||||||
public function testRecordsSearchRoute()
|
public function testRecordsSearchRoute()
|
||||||
{
|
{
|
||||||
$this->setToken($this->userAccessToken);
|
$this->setToken($this->userAccessToken);
|
||||||
self::$DI['client']->request('POST', '/api/v1/records/search/', $this->getParameters(), [], ['HTTP_Accept' => $this->getAcceptMimeType()]);
|
$response = $this->request('POST', '/api/v1/records/search/', $this->getParameters(), ['HTTP_Accept' => $this->getAcceptMimeType()]);
|
||||||
$content = $this->unserialize(self::$DI['client']->getResponse()->getContent());
|
$content = $this->unserialize($response->getContent());
|
||||||
|
|
||||||
$this->evaluateResponse200(self::$DI['client']->getResponse());
|
$this->evaluateResponse200($response);
|
||||||
$this->evaluateMeta200($content);
|
$this->evaluateMeta200($content);
|
||||||
|
|
||||||
$response = $content['response'];
|
$response = $content['response'];
|
||||||
|
|||||||
Reference in New Issue
Block a user