Browse Source

Mock put ONURESTControllerTest

gabriel 7 years ago
parent
commit
b8ff610c66
2 changed files with 8 additions and 6 deletions
  1. 4 4
      composer.lock
  2. 4 2
      src/FTTHBundle/tests/ONURESTControllerTest.php

+ 4 - 4
composer.lock

@@ -1443,7 +1443,7 @@
             "source": {
             "source": {
                 "type": "git",
                 "type": "git",
                 "url": "ssh://git@gogs.infra.flowdat.com:222/VendorSoftwareFlowdat3/DeviceBundle.git",
                 "url": "ssh://git@gogs.infra.flowdat.com:222/VendorSoftwareFlowdat3/DeviceBundle.git",
-                "reference": "f574d1a7a2e021ac4148c633ef94cfaafc4601f4"
+                "reference": "24acf10b6b3fd6399d8ef79a2764b54a998a6a34"
             },
             },
             "type": "library",
             "type": "library",
             "autoload": {
             "autoload": {
@@ -1458,7 +1458,7 @@
                 "bundle",
                 "bundle",
                 "validators"
                 "validators"
             ],
             ],
-            "time": "2017-09-12 19:28:27"
+            "time": "2017-09-14 14:25:33"
         },
         },
         {
         {
             "name": "ik/extra-data-bundle",
             "name": "ik/extra-data-bundle",
@@ -1632,7 +1632,7 @@
             "source": {
             "source": {
                 "type": "git",
                 "type": "git",
                 "url": "ssh://git@200.50.168.30:222/VendorSoftwareFlowdat3/Webservice.git",
                 "url": "ssh://git@200.50.168.30:222/VendorSoftwareFlowdat3/Webservice.git",
-                "reference": "059317c0b666650071dfa6e4999b74125807f40a"
+                "reference": "c9ab505bc8d9d72e89c8a3f8851200f4fb616aeb"
             },
             },
             "require": {
             "require": {
                 "ext-curl": "*",
                 "ext-curl": "*",
@@ -1645,7 +1645,7 @@
                 }
                 }
             },
             },
             "description": "The Flowdat3 Webservice Rest",
             "description": "The Flowdat3 Webservice Rest",
-            "time": "2017-09-14 14:00:58"
+            "time": "2017-09-14 14:51:12"
         },
         },
         {
         {
             "name": "ik/workflow-bundle",
             "name": "ik/workflow-bundle",

+ 4 - 2
src/FTTHBundle/tests/ONURESTControllerTest.php

@@ -39,6 +39,8 @@ class ONURESTControllerTest extends WebTestCaseBase
         $datos = array();
         $datos = array();
         $datos['client'] =
         $datos['client'] =
             json_encode(array(array("name" => "Stock", "id" => 1)));
             json_encode(array(array("name" => "Stock", "id" => 1)));
+        $datos['device'] =
+            json_encode(array(array("name" => "Prueba", "id" => 1)));
         return $datos;
         return $datos;
     }
     }
 
 
@@ -61,6 +63,7 @@ class ONURESTControllerTest extends WebTestCaseBase
 //        $datos['clientId'] = '1';
 //        $datos['clientId'] = '1';
         $datos['transitionState'] = 'ts';
         $datos['transitionState'] = 'ts';
         $datos['tenancyId'] = 1;
         $datos['tenancyId'] = 1;
+        $datos['deviceId'] = 1;
 
 
         if ($key == null) {
         if ($key == null) {
             return $datos;
             return $datos;
@@ -136,12 +139,11 @@ class ONURESTControllerTest extends WebTestCaseBase
      */
      */
     public function testPUT()
     public function testPUT()
     {
     {
+        $this->initDefault($this->obtainDataWebService());
         $response = $this->generateGET();
         $response = $this->generateGET();
         $id = $this->getProperty($response, 'id');
         $id = $this->getProperty($response, 'id');
         // realizo la consulta
         // realizo la consulta
         $data = $this->obtainDataChange($this->obtainData(), array('ponSerialNumber' => 'pon_modifi', 'id' => $id));
         $data = $this->obtainDataChange($this->obtainData(), array('ponSerialNumber' => 'pon_modifi', 'id' => $id));
-        $this->initDefault();
-
         $this->getClient()->request('PUT', $this->getUriPutDelete() . $id, $data);
         $this->getClient()->request('PUT', $this->getUriPutDelete() . $id, $data);
         // obtengo la respuesta
         // obtengo la respuesta
         $response = $this->getClient()->getResponse();
         $response = $this->getClient()->getResponse();