gabriel 6 years ago
parent
commit
e63f8825c8
1 changed files with 10 additions and 12 deletions
  1. 10 12
      src/FTTHBundle/tests/ONURESTControllerTest.php

+ 10 - 12
src/FTTHBundle/tests/ONURESTControllerTest.php

@@ -2,10 +2,8 @@
 
 namespace FTTHBundle\tests;
 
-use WebserviceBundle\tests\WebTestCaseBase;
-use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
 use Symfony\Component\HttpFoundation\Response;
-use Symfony\Bundle\FrameworkBundle\Client;
+use WebserviceBundle\tests\WebTestCaseBase;
 
 /**
  * Class ONURESTControllerTest
@@ -76,15 +74,16 @@ class ONURESTControllerTest extends WebTestCaseBase
     {
         $datos = array();
         $datos['oltId'] = '';
-        $datos['modelId'] = '1';
-        $datos['napId'] = '1';
+        $datos['model'] = '1';
         $datos['nap'] = 1;
-        $datos['profileId'] = '1';
+        $datos['profile'] = '1';
         $datos['mac'] = '00:11:22:33';
         $datos['ponSerialNumber'] = 'pon';
         $datos['clientId'] = 1;
         $datos['tenancyId'] = 1;
         $datos['deviceId'] = 1;
+//        $datos['vlanProfile'] = ;
+//        $datos['onuProfile'] = ;
 
         if ($key == null) {
             return $datos;
@@ -210,7 +209,6 @@ class ONURESTControllerTest extends WebTestCaseBase
         $this->getClient()->request('POST', $this->getUri(), $this->obtainData());
         // obtengo la respuesta
         $response = $this->getClient()->getResponse();
-        var_dump($response);
         $this->assertEquals(201, $response->getStatusCode(), "Error en la respuesta http.");
     }
 
@@ -285,9 +283,9 @@ class ONURESTControllerTest extends WebTestCaseBase
         $this->assertJson($json_orig = $response->getContent(), "No se obtuvo un objeto json.");
 
         $json = json_decode($json_orig, true);
-	if(!isset($json[0])){
-		$this->fail($json_orig);
-	}
+        if (!isset($json[0])) {
+            $this->fail($json_orig);
+        }
         $json = $json[0];
 
         $this->assertEquals("active", $json["administrativeState"]);
@@ -298,8 +296,8 @@ class ONURESTControllerTest extends WebTestCaseBase
         $fakeWebService = $this->getClient()->getContainer()->get('webservice');
         $original->setWebservice($fakeWebService);
 
-	$this->getClient()->request('GET',
-		$this->getUriPutDelete().  $json["id"] . "/apply/administrative_state/active_to_suspend.json" , array());
+        $this->getClient()->request('GET',
+            $this->getUriPutDelete() . $json["id"] . "/apply/administrative_state/active_to_suspend.json", array());
         $response = $this->getClient()->getResponse();
 
         $json = json_decode($response->getContent(), true);