diff --git a/lib/Alchemy/Phrasea/Application/Lightbox.php b/lib/Alchemy/Phrasea/Application/Lightbox.php index ce0fa14aad..1059a6b682 100644 --- a/lib/Alchemy/Phrasea/Application/Lightbox.php +++ b/lib/Alchemy/Phrasea/Application/Lightbox.php @@ -564,6 +564,8 @@ return call_user_func( $app->error(function($e) use($app) { + + var_dump($e->getMessage()); /* @var $twig \Twig_Environment */ $twig = $app['Core']->getTwig(); $registry = \registry::get_instance(); diff --git a/lib/unitTest/Alchemy/Phrasea/Application/LightboxTest.php b/lib/unitTest/Alchemy/Phrasea/Application/LightboxTest.php index d17dcc7725..8efbbb3a34 100644 --- a/lib/unitTest/Alchemy/Phrasea/Application/LightboxTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Application/LightboxTest.php @@ -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() . '/'); diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BasketTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BasketTest.php index 613fd39fa3..4027588e7c 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BasketTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BasketTest.php @@ -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 */