fix some tests

This commit is contained in:
Nicolas Le Goff
2012-02-17 19:48:23 +01:00
parent 28d0952db1
commit fb08da320d
3 changed files with 13 additions and 5 deletions

View File

@@ -307,8 +307,12 @@ class ApplicationLightboxTest extends PhraseanetWebTestCaseAuthenticatedAbstract
$basket = $this->insertOneBasket();
$crawler = $this->client->request('POST', '/ajax/SET_RELEASE/' . $basket->getId() . '/');
$this->assertEquals(400, $this->client->getResponse()->getStatusCode());
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
$this->assertEquals('application/json', $this->client->getResponse()->headers->get('Content-type'));
$datas = json_decode($this->client->getResponse()->getContent());
$this->assertTrue(is_object($datas), 'asserting good json datas');
$this->assertTrue($datas->error);
$validationBasket = $this->insertOneValidationBasket();
$crawler = $this->client->request('POST', '/ajax/SET_RELEASE/' . $validationBasket->getId() . '/');

View File

@@ -505,16 +505,18 @@ class ControllerBasketTest extends PhraseanetWebTestCaseAuthenticatedAbstract
$route = sprintf('/baskets/%s/stealElements/', $Basket_2->getId());
$crawler = $this->client->request(
$this->client->request(
'POST', $route, array(
'elements' => array($BasketElement->getId(), 'ufdsd')
), array()
), array(), array(
"HTTP_ACCEPT" => "application/json"
)
);
$response = $this->client->getResponse();
$this->assertEquals(302, $response->getStatusCode());
$this->assertEquals(200, $response->getStatusCode());
$em = self::$core->getEntityManager();
/* @var $em \Doctrine\ORM\EntityManager */