|
@@ -1,6 +1,6 @@
|
|
|
<?php
|
|
|
|
|
|
-namespace FTTHBundle\tests;
|
|
|
+namespace CablemodemBundle\tests;
|
|
|
|
|
|
use WebserviceBundle\tests\WebTestCaseBase;
|
|
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
|
@@ -8,8 +8,8 @@ use Symfony\Component\HttpFoundation\Response;
|
|
|
use Symfony\Bundle\FrameworkBundle\Client;
|
|
|
|
|
|
/**
|
|
|
- * Class ProfileRESTControllerTest
|
|
|
- * @package FTTHBundle\tests
|
|
|
+ * Class CablemodemRESTControllerTest
|
|
|
+ * @package CablemodemBundle\tests
|
|
|
* En caso de modificar las tablas solo se deberia modificar la funcion "obtainData" agregando los campos necesarios.
|
|
|
*/
|
|
|
class CablemodemRESTControllerTest extends WebTestCaseBase
|
|
@@ -63,8 +63,8 @@ class CablemodemRESTControllerTest extends WebTestCaseBase
|
|
|
|
|
|
/**
|
|
|
* Realiza una busqueda.
|
|
|
- * get_profiles -> /api/profiles.{_format}
|
|
|
- * controller: FTTHBundle:ProfileREST:cget
|
|
|
+ * get_cablemodems -> /api/cablemodems.{_format}
|
|
|
+ * controller: CablemodemBundle:CablemodemREST:cget
|
|
|
* Method: GET
|
|
|
* @param string $uri Contiene la direccion.
|
|
|
* @param array $data Contiene los filtros a utilizar en la busqueda.
|
|
@@ -87,8 +87,8 @@ class CablemodemRESTControllerTest extends WebTestCaseBase
|
|
|
|
|
|
/**
|
|
|
* Realiza el alta.
|
|
|
- * post_profile -> /api/profiles.{_format}
|
|
|
- * controller: FTTHBundle:ProfileREST:post
|
|
|
+ * post_cablemodems -> /api/cablemodems.{_format}
|
|
|
+ * controller: CablemodemBundle:CablemodemREST:post
|
|
|
* Method: POST
|
|
|
*/
|
|
|
public function testPOST()
|
|
@@ -104,8 +104,8 @@ class CablemodemRESTControllerTest extends WebTestCaseBase
|
|
|
|
|
|
/**
|
|
|
* Realiza una busqueda.
|
|
|
- * get_profiles -> /api/profiles.{_format}
|
|
|
- * controller: FTTHBundle:ProfileREST:cget
|
|
|
+ * get_cablemodems -> /api/cablemodems.{_format}
|
|
|
+ * controller: CablemodemBundle:CablemodemREST:cget
|
|
|
* Method: GET
|
|
|
*/
|
|
|
public function testGET_POST()
|
|
@@ -115,13 +115,13 @@ class CablemodemRESTControllerTest extends WebTestCaseBase
|
|
|
// 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('mac'), strtolower($response->getContent()), "Error al buscar al onu.");
|
|
|
+ $this->assertContains($this->obtainData('mac'), strtolower($response->getContent()), "Error al buscar al cablemodem.");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Realiza una modificacion.
|
|
|
- * put_profile -> /api/profiles.{_format}
|
|
|
- * controller: FTTHBundle:ProfileREST:put
|
|
|
+ * put_cablemodems -> /api/cablemodems.{_format}
|
|
|
+ * controller: CablemodemBundle:CablemodemREST:put
|
|
|
* Method: PUT
|
|
|
*/
|
|
|
public function testPUT()
|
|
@@ -143,8 +143,8 @@ class CablemodemRESTControllerTest extends WebTestCaseBase
|
|
|
|
|
|
/**
|
|
|
* Realiza una busqueda.
|
|
|
- * get_profiles -> /api/profiles.{_format}
|
|
|
- * controller: FTTHBundle:ProfileREST:cget
|
|
|
+ * get_cablemodems -> /api/cablemodems.{_format}
|
|
|
+ * controller: CablemodemBundle:CablemodemREST:cget
|
|
|
* Method: GET
|
|
|
*/
|
|
|
public function testGET_PUT()
|
|
@@ -153,14 +153,14 @@ class CablemodemRESTControllerTest extends WebTestCaseBase
|
|
|
// 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('aviso', strtolower($response->getContent()), "Error al buscar al onu modificado.");
|
|
|
+ $this->assertContains('aviso', strtolower($response->getContent()), "Error al buscar el cablemodem modificado.");
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Realiza una baja.
|
|
|
- * delete_profile -> /api/profiles.{_format}
|
|
|
- * controller: FTTHBundle:ProfileREST:delete
|
|
|
+ * delete_cablemodems -> /api/cablemodems.{_format}
|
|
|
+ * controller: CablemodemBundle:CablemodemREST:delete
|
|
|
* Method: DELETE
|
|
|
*/
|
|
|
public function testDELETE()
|
|
@@ -180,8 +180,8 @@ class CablemodemRESTControllerTest extends WebTestCaseBase
|
|
|
|
|
|
/**
|
|
|
* Realiza una busqueda.
|
|
|
- * get_profiles -> /api/profiles.{_format}
|
|
|
- * controller: FTTHBundle:ProfileREST:cget
|
|
|
+ * get_cablemodems -> /api/cablemodems.{_format}
|
|
|
+ * controller: CablemodemBundle:CablemodemREST:cget
|
|
|
* Method: GET
|
|
|
*/
|
|
|
public function testGET_DELETE()
|
|
@@ -192,72 +192,4 @@ class CablemodemRESTControllerTest extends WebTestCaseBase
|
|
|
$this->assertJson($response->getContent(), "No se obtuvo un objeto json.");
|
|
|
}
|
|
|
|
|
|
-// /**
|
|
|
-// * Realiza el alta.
|
|
|
-// * post_profile -> /api/profiles.{_format}
|
|
|
-// * controller: FTTHBundle:ProfileREST:post
|
|
|
-// * Method: POST
|
|
|
-// */
|
|
|
-// public function testMIGRATIONS()
|
|
|
-// {
|
|
|
-// // inicializo con los datos del webservicemock
|
|
|
-// $this->initDefault();
|
|
|
-// // hago la inserccion llamando al servicio por post
|
|
|
-// $this->getClient()->request('POST', '/api/profiles/profiles/migrate.json', $this->obtainData());
|
|
|
-// // obtengo la respuesta
|
|
|
-// $response = $this->getClient()->getResponse();
|
|
|
-// $this->assertEquals(201, $response->getStatusCode(), "Error en la respuesta http.");
|
|
|
-// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * Realiza una busqueda.
|
|
|
-// * get_profiles -> /api/profiles.{_format}
|
|
|
-// * controller: FTTHBundle:ProfileREST:cget
|
|
|
-// * Method: GET
|
|
|
-// */
|
|
|
-// public function testGET_MIGRATIONS()
|
|
|
-// {
|
|
|
-// // 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('name'), strtolower($response->getContent()), "Error al buscar al onu.");
|
|
|
-// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * Realiza una baja.
|
|
|
-// * delete_profile -> /api/profiles.{_format}
|
|
|
-// * controller: FTTHBundle:ProfileREST:delete
|
|
|
-// * Method: DELETE
|
|
|
-// */
|
|
|
-// public function testDELETE_MIGRATIONS()
|
|
|
-// {
|
|
|
-// // realizo la consulta
|
|
|
-// $response = $this->generateGET();
|
|
|
-// // obtengo el id de la respuesta de la busqueda
|
|
|
-// $id = $this->getProperty($response, 'id');
|
|
|
-// $this->initDefault();
|
|
|
-// // realizo la consulta
|
|
|
-// $data = array('tenancy' => 1);
|
|
|
-// $this->getClient()->request('DELETE', $this->getUriPutDelete() . $id, $data);
|
|
|
-// // obtengo la respuesta
|
|
|
-// $response = $this->getClient()->getResponse();
|
|
|
-// $this->assertEquals(204, $response->getStatusCode(), "Error en la respuesta http.");
|
|
|
-// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * Realiza una busqueda.
|
|
|
-// * get_profiles -> /api/profiles.{_format}
|
|
|
-// * controller: FTTHBundle:ProfileREST:cget
|
|
|
-// * Method: GET
|
|
|
-// */
|
|
|
-// public function testGET_DELETE_MIGRATIONS()
|
|
|
-// {
|
|
|
-// $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.");
|
|
|
-// }
|
|
|
-
|
|
|
}
|