mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 10:23:17 +00:00
Refactor OrderTest
This commit is contained in:
@@ -99,12 +99,11 @@ class OrderTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
foreach ($order->getElements() as $element) {
|
foreach ($order->getElements() as $element) {
|
||||||
$parameters[] = $element->getId();
|
$parameters[] = $element->getId();
|
||||||
}
|
}
|
||||||
$client = $this->getClient();
|
$response = $this->request('POST', '/prod/order/' . $order->getId() . '/send/', ['elements' => $parameters]);
|
||||||
$client->request('POST', '/prod/order/' . $order->getId() . '/send/', ['elements' => $parameters]);
|
$this->assertTrue($response->isRedirect(), 'Could not validate some elements. not a redirect');
|
||||||
$this->assertTrue($client->getResponse()->isRedirect());
|
$url = parse_url($response->headers->get('location'));
|
||||||
$url = parse_url($client->getResponse()->headers->get('location'));
|
|
||||||
parse_str($url['query']);
|
parse_str($url['query']);
|
||||||
$this->assertTrue( strpos($url['query'], 'success=1') === 0);
|
$this->assertTrue(strpos($url['query'], 'success=1') === 0, 'Validation of elements is not successful');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSendOrderJson()
|
public function testSendOrderJson()
|
||||||
|
|||||||
Reference in New Issue
Block a user