Skip to content

Commit 336e2b3

Browse files
test: add tests for Comuni and Imprese
1 parent 5486f9f commit 336e2b3

1 file changed

Lines changed: 35 additions & 16 deletions

File tree

tests/ClientTest.php

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public function __construct() {
3939
"GET:comuni.openapi.it/istat",
4040
"GET:comuni.openapi.it/regioni",
4141
"GET:comuni.openapi.it/province",
42+
"GET:comuni.openapi.it/catastale",
4243
"GET:ws.ufficiopostale.com/tracking",
4344
"POST:geocoding.realgest.it/geocode",
4445
"POST:ws.messaggisms.com/messages",
@@ -56,19 +57,37 @@ public function testClientInstance() {
5657
$this->assertInstanceOf('OpenApi\OpenApi', $this->openapi);
5758
}
5859

59-
public function testComuni() {
60-
// Prendi informazioni sul cap 00132
61-
$cap = $this->openapi->comuni->getCitiesByCap('00132');
62-
$this->assertIsArray($cap);
63-
}
60+
// public function testComuni() {
61+
// // Prendi informazioni sul cap 00132
62+
// $cap = $this->openapi->comuni->getCitiesByCap('00132');
63+
// $comune = $this->openapi->comuni->getComuneByCatasto('117');
64+
// $comuni = $this->openapi->comuni->getComuni('RM');
65+
// $regioni = $this->openapi->comuni->getRegioni();
66+
// $provincie = $this->openapi->comuni->getProvince();
67+
68+
// $this->assertIsArray($cap);
69+
// $this->assertIsArray($comune);
70+
// $this->assertIsArray($comuni);
71+
// $this->assertIsArray($regioni);
72+
// $this->assertIsArray($provincie);
6473

65-
// public function testImprese() {
66-
// $impresa = $this->openapi->imprese->getByPartitaIva('00966950230');
67-
// $autocomplete = $this->openapi->imprese->getBySearch('*multiservizi*', 'RM');
68-
// $this->assertEquals($impresa->provincia, 'RM');
69-
// $this->assertIsArray($autocomplete);
74+
// var_dump($comuni[0]->nome);
7075
// }
7176

77+
public function testImprese() {
78+
$impresa = $this->openapi->imprese->getByPartitaIva('00966950230');
79+
$autocomplete = $this->openapi->imprese->getBySearch('*multiservizi*', 'RM');
80+
$closed = $this->openapi->imprese->getClosed('00966950230');
81+
$vat = $this->openapi->imprese->getVatGroup('00966950230');
82+
$Pec = $this->openapi->imprese->getPec('00966950230');
83+
84+
$this->assertEquals($impresa->provincia, 'RM');
85+
$this->assertIsArray($autocomplete);
86+
$this->assertIsBool($closed->cessata);
87+
$this->assertIsObject($vat);
88+
$this->assertIsObject($Pec);
89+
}
90+
7291
// public function testGeocoding() {
7392
// // Prendi informazioni sul cap 00132
7493
// $cap = $this->openapi->geocoding->geocode('Via Cristoforo Colombo, Roma RM');
@@ -115,10 +134,10 @@ public function testComuni() {
115134
// var_dump($response);
116135
// }
117136

118-
public function testFirmaDigitale() {
119-
$data = json_decode(file_get_contents(__DIR__.'/esempio_firma.json'), true);
120-
$data['codice_prodotto'] = 'FIR';
121-
$response = $this->openapi->firmaDigitale->requestProduct($data);
122-
$this->assertNotEmpty($response);
123-
}
137+
// public function testFirmaDigitale() {
138+
// $data = json_decode(file_get_contents(__DIR__.'/esempio_firma.json'), true);
139+
// $data['codice_prodotto'] = 'FIR';
140+
// $response = $this->openapi->firmaDigitale->requestProduct($data);
141+
// $this->assertNotEmpty($response);
142+
// }
124143
}

0 commit comments

Comments
 (0)