浏览代码

first fail

Luciano Andrade 7 年之前
父节点
当前提交
5142a5cd15
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      src/FTTHBundle/tests/ONURESTControllerTest.php

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

@@ -205,9 +205,12 @@ class ONURESTControllerTest extends WebTestCaseBase
         $response = $this->generateGET();
         $response = $this->generateGET();
         // verifco el resultado
         // verifco el resultado
         $this->assertEquals(200, $response->getStatusCode(), "Error en la respuesta http.");
         $this->assertEquals(200, $response->getStatusCode(), "Error en la respuesta http.");
-        $this->assertJson($json = $response->getContent(), "No se obtuvo un objeto json.");
+        $this->assertJson($json_orig = $response->getContent(), "No se obtuvo un objeto json.");
 
 
-        $json = json_decode($json, true);
+        $json = json_decode($json_orig, true);
+	if(!isset($json[0])){
+		$this->fail($json_orig);
+	}
         $json = $json[0];
         $json = $json[0];
 
 
         $this->assertEquals("active", $json["administrativeState"]);
         $this->assertEquals("active", $json["administrativeState"]);