|
@@ -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}
|