gabriel há 7 anos atrás
pai
commit
4542f9a217
1 ficheiros alterados com 36 adições e 35 exclusões
  1. 36 35
      src/FTTHBundle/tests/ONURESTControllerTest.php

+ 36 - 35
src/FTTHBundle/tests/ONURESTControllerTest.php

@@ -119,41 +119,42 @@ class ONURESTControllerTest extends WebTestCaseBase
         $this->assertEquals(201, $response->getStatusCode(), "Error en la respuesta http.");
         $this->assertEquals(201, $response->getStatusCode(), "Error en la respuesta http.");
     }
     }
 
 
-//    /**
-//     * Realiza una busqueda.
-//     * get_onus -> /api/onus.{_format}
-//     * controller: ClientBundle:ClientREST:cget
-//     * Method: GET
-//     */
-//    public function testGET_POST()
-//    {
-//        // obtengo la respuesta
-//        $response = $this->generateGET();
-//        // verifco el resultado
-//        $this->assertEquals(200, $response->getStatusCode(), "Error en la respuesta http.");
-//        $this->assertJson($response->getContent(), "No se obtuvo un objeto json.");
-//        $this->assertContains($this->obtainData('ponSerialNumber'), strtolower($response->getContent()), "Error al buscar al onu.");
-//    }
-//
-//    /**
-//     * Realiza una modificacion.
-//     * put_onu -> /api/onus.{_format}
-//     * controller: ClientBundle:ClientREST:put
-//     * Method: PUT
-//     */
-//    public function testPUT()
-//    {
-//        $this->initDefault($this->obtainDataWebService());
-//        $response = $this->generateGET();
-//        $id = $this->getProperty($response, 'id');
-//        // realizo la consulta
-//        $data = $this->obtainDataChange($this->obtainData(), array('ponSerialNumber' => 'pon_modifi', 'id' => $id));
-//        $this->getClient()->request('PUT', $this->getUriPutDelete() . $id, $data);
-//        // obtengo la respuesta
-//        $response = $this->getClient()->getResponse();
-//        $this->assertEquals(200, $response->getStatusCode(), "Error en la respuesta http.");
-//    }
-//
+    /**
+     * Realiza una busqueda.
+     * get_onus -> /api/onus.{_format}
+     * controller: ClientBundle:ClientREST:cget
+     * Method: GET
+     */
+    public function testGET_POST()
+    {
+        // obtengo la respuesta
+        $response = $this->generateGET();
+        // verifco el resultado
+        $this->assertEquals(200, $response->getStatusCode(), "Error en la respuesta http.");
+        $this->assertJson($response->getContent(), "No se obtuvo un objeto json.");
+        $this->assertContains($this->obtainData('ponSerialNumber'), strtolower($response->getContent()), "Error al buscar al onu.");
+    }
+
+    /**
+     * Realiza una modificacion.
+     * put_onu -> /api/onus.{_format}
+     * controller: ClientBundle:ClientREST:put
+     * Method: PUT
+     */
+    public function testPUT()
+    {
+        $this->initDefault($this->obtainDataWebService());
+        $this->setListener();
+        $response = $this->generateGET();
+        $id = $this->getProperty($response, 'id');
+        // realizo la consulta
+        $data = $this->obtainDataChange($this->obtainData(), array('ponSerialNumber' => 'pon_modifi', 'id' => $id));
+        $this->getClient()->request('PUT', $this->getUriPutDelete() . $id, $data);
+        // obtengo la respuesta
+        $response = $this->getClient()->getResponse();
+        $this->assertEquals(200, $response->getStatusCode(), "Error en la respuesta http.");
+    }
+
 //    /**
 //    /**
 //     * Realiza una busqueda.
 //     * Realiza una busqueda.
 //     * get_onus -> /api/onus.{_format}
 //     * get_onus -> /api/onus.{_format}