@@ 29-48 (lines=20) @@ | ||
26 | parent::setUp(); |
|
27 | } |
|
28 | ||
29 | public function testGetWholeSectoralDistributionActionActionCanBeAccessed() |
|
30 | { |
|
31 | $this->dispatch('/informe/distribucion-sectores/2014', 'GET'); |
|
32 | $this->assertResponseStatusCode(200); |
|
33 | $this->assertResponseHeaderContains('Content-Type', 'application/json; charset=utf-8'); |
|
34 | $this->assertModuleName('api'); |
|
35 | $this->assertControllerName(DistributionReportController::class); |
|
36 | $this->assertControllerClass('DistributionReportController'); |
|
37 | $this->assertMatchedRouteName('informe-todos-sectores'); |
|
38 | ||
39 | $data = $this->getResponse()->getContent(); |
|
40 | ||
41 | $this->assertJson($data); |
|
42 | ||
43 | $data = Json::decode($data, Json::TYPE_ARRAY); |
|
44 | ||
45 | $this->assertArrayHasKey('sector_1', $data); |
|
46 | $this->assertArrayHasKey('colores', $data); |
|
47 | $this->assertArrayHasKey('descripciones', $data); |
|
48 | } |
|
49 | ||
50 | public function testGetSectoralDistributionActionCanBeAccessed() |
|
51 | { |
|
@@ 50-69 (lines=20) @@ | ||
47 | $this->assertArrayHasKey('descripciones', $data); |
|
48 | } |
|
49 | ||
50 | public function testGetSectoralDistributionActionCanBeAccessed() |
|
51 | { |
|
52 | $this->dispatch('/informe/distribucion-sector/2014/1', 'GET'); |
|
53 | $this->assertResponseStatusCode(200); |
|
54 | $this->assertResponseHeaderContains('Content-Type', 'application/json; charset=utf-8'); |
|
55 | $this->assertModuleName('api'); |
|
56 | $this->assertControllerName(DistributionReportController::class); |
|
57 | $this->assertControllerClass('DistributionReportController'); |
|
58 | $this->assertMatchedRouteName('informe-por-sector'); |
|
59 | ||
60 | $data = $this->getResponse()->getContent(); |
|
61 | ||
62 | $this->assertJson($data); |
|
63 | ||
64 | $data = Json::decode($data, Json::TYPE_ARRAY); |
|
65 | ||
66 | $this->assertArrayHasKey('graph_data', $data); |
|
67 | $this->assertArrayHasKey('sector', $data); |
|
68 | $this->assertArrayHasKey('totalActividades', $data); |
|
69 | } |
|
70 | ||
71 | public function testGetGasesDistributionActionCanBeAccessed() |
|
72 | { |
|
@@ 71-90 (lines=20) @@ | ||
68 | $this->assertArrayHasKey('totalActividades', $data); |
|
69 | } |
|
70 | ||
71 | public function testGetGasesDistributionActionCanBeAccessed() |
|
72 | { |
|
73 | $this->dispatch('/informe/distribucion-gases/2014', 'GET'); |
|
74 | $this->assertResponseStatusCode(200); |
|
75 | $this->assertResponseHeaderContains('Content-Type', 'application/json; charset=utf-8'); |
|
76 | $this->assertModuleName('api'); |
|
77 | $this->assertControllerName(DistributionReportController::class); |
|
78 | $this->assertControllerClass('DistributionReportController'); |
|
79 | $this->assertMatchedRouteName('informe-gas'); |
|
80 | ||
81 | $data = $this->getResponse()->getContent(); |
|
82 | ||
83 | $this->assertJson($data); |
|
84 | ||
85 | $data = Json::decode($data, Json::TYPE_ARRAY); |
|
86 | ||
87 | $this->assertArrayHasKey('colores', $data); |
|
88 | $this->assertArrayHasKey('gases', $data); |
|
89 | $this->assertArrayHasKey('valores', $data); |
|
90 | } |
|
91 | ||
92 | public function testGetSectoralGasesDistributionActionCanBeAccessed() |
|
93 | { |
@@ 29-48 (lines=20) @@ | ||
26 | parent::setUp(); |
|
27 | } |
|
28 | ||
29 | public function testGetWholeSectoralEvolutionActionCanBeAccessed() |
|
30 | { |
|
31 | $this->dispatch('/informe/evolucion-sectores', 'GET'); |
|
32 | $this->assertResponseStatusCode(200); |
|
33 | $this->assertResponseHeaderContains('Content-Type', 'application/json; charset=utf-8'); |
|
34 | $this->assertModuleName('api'); |
|
35 | $this->assertControllerName(EvolutionReportController::class); |
|
36 | $this->assertControllerClass('EvolutionReportController'); |
|
37 | $this->assertMatchedRouteName('informe-evolucion-sectores'); |
|
38 | ||
39 | $data = $this->getResponse()->getContent(); |
|
40 | ||
41 | $this->assertJson($data); |
|
42 | ||
43 | $data = Json::decode($data, Json::TYPE_ARRAY); |
|
44 | ||
45 | $this->assertArrayHasKey('column_1', $data); |
|
46 | $this->assertArrayHasKey('colores', $data); |
|
47 | $this->assertArrayHasKey('column_2', $data); |
|
48 | } |
|
49 | ||
50 | public function testGetSectoralEvolutionActionCanBeAccessed() |
|
51 | { |
|
@@ 50-69 (lines=20) @@ | ||
47 | $this->assertArrayHasKey('column_2', $data); |
|
48 | } |
|
49 | ||
50 | public function testGetSectoralEvolutionActionCanBeAccessed() |
|
51 | { |
|
52 | $this->dispatch('/informe/evolucion-sector/1', 'GET'); |
|
53 | $this->assertResponseStatusCode(200); |
|
54 | $this->assertResponseHeaderContains('Content-Type', 'application/json; charset=utf-8'); |
|
55 | $this->assertModuleName('api'); |
|
56 | $this->assertControllerName(EvolutionReportController::class); |
|
57 | $this->assertControllerClass('EvolutionReportController'); |
|
58 | $this->assertMatchedRouteName('informe-evolucion-sector'); |
|
59 | ||
60 | $data = $this->getResponse()->getContent(); |
|
61 | ||
62 | $this->assertJson($data); |
|
63 | ||
64 | $data = Json::decode($data, Json::TYPE_ARRAY); |
|
65 | ||
66 | $this->assertArrayHasKey('column_1', $data); |
|
67 | $this->assertArrayHasKey('colores', $data); |
|
68 | $this->assertArrayHasKey('column_2', $data); |
|
69 | } |
|
70 | ||
71 | public function testGetSectoralEvolutionSubactivityActionCanBeAccessed() |
|
72 | { |
|
@@ 71-90 (lines=20) @@ | ||
68 | $this->assertArrayHasKey('column_2', $data); |
|
69 | } |
|
70 | ||
71 | public function testGetSectoralEvolutionSubactivityActionCanBeAccessed() |
|
72 | { |
|
73 | $this->dispatch('/informe/evolucion-sector-subactividad/2', 'GET'); |
|
74 | $this->assertResponseStatusCode(200); |
|
75 | $this->assertResponseHeaderContains('Content-Type', 'application/json; charset=utf-8'); |
|
76 | $this->assertModuleName('api'); |
|
77 | $this->assertControllerName(EvolutionReportController::class); |
|
78 | $this->assertControllerClass('EvolutionReportController'); |
|
79 | $this->assertMatchedRouteName('informe-evolucion-sector-subactividad'); |
|
80 | ||
81 | $data = $this->getResponse()->getContent(); |
|
82 | ||
83 | $this->assertJson($data); |
|
84 | ||
85 | $data = Json::decode($data, Json::TYPE_ARRAY); |
|
86 | ||
87 | $this->assertArrayHasKey('column_1', $data); |
|
88 | $this->assertArrayHasKey('groups', $data); |
|
89 | $this->assertArrayHasKey('column_3', $data); |
|
90 | } |
|
91 | ||
92 | public function testGetSectoralEvolutionSubactivityCategoryActionCanBeAccessed() |
|
93 | { |