11<?php
22
3+ use OpenApi \classes \utility \UfficioPostale \Objects \Recipient ;
4+ use OpenApi \classes \utility \UfficioPostale \Objects \Sender ;
35use OpenApi \OpenApi ;
46use PHPUnit \Framework \TestCase ;
57use Symfony \Component \Dotenv \Dotenv ;
@@ -36,6 +38,7 @@ public function __construct() {
3638 "GET:comuni.openapi.it/istat " ,
3739 "GET:comuni.openapi.it/regioni " ,
3840 "GET:comuni.openapi.it/province " ,
41+ "GET:ws.ufficiopostale.com/tracking " ,
3942 "POST:geocoding.realgest.it/geocode "
4043 ];
4144
@@ -53,9 +56,36 @@ public function testComuni() {
5356 $ this ->assertIsArray ($ cap );
5457 }
5558
56- public function testGeocoding () {
57- // Prendi informazioni sul cap 00132
58- $ cap = $ this ->openapi ->geocoding ->geocode ('Via Cristoforo Colombo, Roma RM ' );
59- $ this ->assertIsArray ($ cap );
59+ // public function testGeocoding() {
60+ // // Prendi informazioni sul cap 00132
61+ // $cap = $this->openapi->geocoding->geocode('Via Cristoforo Colombo, Roma RM');
62+ // $this->assertIsArray($cap);
63+ // }
64+
65+ public function testUfficioPostale () {
66+ $ track = $ this ->openapi ->ufficiopostale ->track ($ _ENV ['TRACK_TEST ' ]);
67+ $ this ->assertEquals (true , $ track ->success );
68+ var_dump ($ track );
69+
70+ $ raccomandata = $ this ->openapi ->ufficiopostale ->createRaccomandata ();
71+ var_dump ($ raccomandata );
72+
73+ $ data = new stdClass ();
74+ $ sender = new Sender ([
75+ 'firstName ' => 'John ' ,
76+ 'secondName ' => 'Doe ' ,
77+ 'companyName ' => 'example-spa ' ,
78+ ]);
79+
80+ $ recipient = new Recipient ([
81+ 'firstName ' => 'John ' ,
82+ 'secondName ' => 'Doe ' ,
83+ 'companyName ' => 'example-spa ' ,
84+ ]);
85+
86+ $ data ->sender = $ sender ;
87+ $ data ->recipient = $ recipient ;
88+
89+ $ raccomandata ->creaRaccomandataByData ();
6090 }
6191}
0 commit comments