|
@@ -14,6 +14,14 @@ use Symfony\Bundle\FrameworkBundle\Client;
|
|
|
*/
|
|
|
class CablemodemRESTControllerTest extends WebTestCaseBase
|
|
|
{
|
|
|
+ /**
|
|
|
+ * @return string Retorna la uri a consultar.
|
|
|
+ */
|
|
|
+ protected function getUriProfiles()
|
|
|
+ {
|
|
|
+ return '/api/profiles.json';
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @return string Retorna la uri a consultar.
|
|
|
*/
|
|
@@ -49,6 +57,37 @@ class CablemodemRESTControllerTest extends WebTestCaseBase
|
|
|
$datos['transitionState'] = 'activo';
|
|
|
$datos['extraData'] = '';
|
|
|
$datos['tenancyId'] = 1;
|
|
|
+ $datos['profile'] = 1;
|
|
|
+
|
|
|
+
|
|
|
+ if ($key == null) {
|
|
|
+ return $datos;
|
|
|
+ } else {
|
|
|
+ if (isset($datos[$key])) {
|
|
|
+ return $datos[$key];
|
|
|
+ } else {
|
|
|
+ throw new \Exception("No se seteo la key del dato a obtener. key=" . $key);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Genera los datos a manipular.
|
|
|
+ * @param string $key Contiene la key a buscar en los datos.
|
|
|
+ * @return array|string Retorna el array con los datos o el valor de la key pasada como parametro.
|
|
|
+ * @throws \Exception Lanza un excepcion en caso de no encontrar la key.
|
|
|
+ */
|
|
|
+ protected function obtainDataProfiles($key = null)
|
|
|
+ {
|
|
|
+ $datos = [
|
|
|
+ 'name' => 'Profile',
|
|
|
+ 'downstream' => null,
|
|
|
+ 'upstream' => null,
|
|
|
+ 'filtroUpload' => null,
|
|
|
+ 'filtroDownload' => null,
|
|
|
+ 'maxCpe' => null,
|
|
|
+ 'tenancyId' => 1,
|
|
|
+ ];
|
|
|
|
|
|
if ($key == null) {
|
|
|
return $datos;
|
|
@@ -95,6 +134,7 @@ class CablemodemRESTControllerTest extends WebTestCaseBase
|
|
|
{
|
|
|
// inicializo con los datos del webservicemock
|
|
|
$this->initDefault();
|
|
|
+ $this->getClient()->request('POST', $this->getUriProfile(), $this->obtainDataProfile());
|
|
|
// hago la inserccion llamando al servicio por post
|
|
|
$this->getClient()->request('POST', $this->getUri(), $this->obtainData());
|
|
|
// obtengo la respuesta
|