Guillermo Espinoza 7 years ago
parent
commit
3318b8efd4
1 changed files with 16 additions and 9 deletions
  1. 16 9
      src/CablemodemBundle/tests/CMTSRESTControllerTest.php

+ 16 - 9
src/CablemodemBundle/tests/CMTSRESTControllerTest.php

@@ -140,16 +140,23 @@ class CMTSRESTControllerTest extends WebTestCaseBase
      */
     public function testPOST()
     {
-        // inicializo con los datos del webservicemock
-        $this->initDefault($this->obtainDataWebService());
-        // seteo los datos del listener
-        $this->setListener();
-        // hago la inserccion llamando al servicio por post
-        $this->getClient()->request('POST', $this->getPOSTUri(), $this->obtainData());
-        // obtengo la respuesta
-        $response = $this->getClient()->getResponse();
+        try {
+
+            // inicializo con los datos del webservicemock
+            $this->initDefault($this->obtainDataWebService());
+            // seteo los datos del listener
+            $this->setListener();
+            // hago la inserccion llamando al servicio por post
+            $this->getClient()->request('POST', $this->getPOSTUri(), $this->obtainData());
+            // obtengo la respuesta
+            $response = $this->getClient()->getResponse();
 
-        $this->assertEquals(201, $response->getStatusCode(), "Error en la respuesta http.");
+            $this->assertEquals(201, $response->getStatusCode(), "Error en la respuesta http.");
+        } catch (\Exception $ex) {
+            if ($ex instanceof HandledErrorException) {
+                $ex->cleanOutput();
+            }
+        }
     }
 
     /**