22namespace TotalVoice ;
33
44use TotalVoice \Handler \Http ;
5+ use TotalVoice \Api \Api ;
6+ use TotalVoice \Api \ApiRelatorio ;
7+ use TotalVoice \Api \ApiRelatorioChamadas ;
8+ use TotalVoice \Api \Audio ;
9+ use TotalVoice \Api \Bina ;
10+ use TotalVoice \Api \Central ;
11+ use TotalVoice \Api \Chamada ;
12+ use TotalVoice \Api \Composto ;
13+ use TotalVoice \Api \Conferencia ;
14+ use TotalVoice \Api \Conta ;
15+ use TotalVoice \Api \Did ;
16+ use TotalVoice \Api \Fila ;
17+ use TotalVoice \Api \Perfil ;
18+ use TotalVoice \Api \Sms ;
19+ use TotalVoice \Api \Status ;
20+ use TotalVoice \Api \Tts ;
21+ use TotalVoice \Api \Verificacao ;
522
623class ClientTest extends \PHPUnit_Framework_TestCase
724{
@@ -45,4 +62,51 @@ public function queryTest()
4562 $ query = $ this ->client ->query (['query ' => 'string ' ]);
4663 $ this ->assertEquals ("?query=string " , $ query );
4764 }
65+
66+ /**
67+ * @test
68+ */
69+ public function apiInstancesTest ()
70+ {
71+ $ audio = $ this ->client ->audio ;
72+ $ bina = $ this ->client ->bina ;
73+ $ central = $ this ->client ->central ;
74+ $ chamada = $ this ->client ->chamada ;
75+ $ composto = $ this ->client ->composto ;
76+ $ conferencia = $ this ->client ->conferencia ;
77+ $ conta = $ this ->client ->conta ;
78+ $ did = $ this ->client ->did ;
79+ $ fila = $ this ->client ->fila ;
80+ $ perfil = $ this ->client ->perfil ;
81+ $ sms = $ this ->client ->sms ;
82+ $ status = $ this ->client ->status ;
83+ $ tts = $ this ->client ->tts ;
84+ $ verificacao = $ this ->client ->verificacao ;
85+
86+ $ this ->assertInstanceOf (Audio::class, $ audio );
87+ $ this ->assertInstanceOf (Bina::class, $ bina );
88+ $ this ->assertInstanceOf (Central::class, $ central );
89+ $ this ->assertInstanceOf (Chamada::class, $ chamada );
90+ $ this ->assertInstanceOf (Composto::class, $ composto );
91+ $ this ->assertInstanceOf (Conferencia::class, $ conferencia );
92+ $ this ->assertInstanceOf (Conta::class, $ conta );
93+ $ this ->assertInstanceOf (Did::class, $ did );
94+ $ this ->assertInstanceOf (Fila::class, $ fila );
95+ $ this ->assertInstanceOf (Perfil::class, $ perfil );
96+ $ this ->assertInstanceOf (Sms::class, $ sms );
97+ $ this ->assertInstanceOf (Status::class, $ status );
98+ $ this ->assertInstanceOf (Tts::class, $ tts );
99+ $ this ->assertInstanceOf (Verificacao::class, $ verificacao );
100+ }
101+
102+ /**
103+ * @test
104+ */
105+ public function apiThrowClientException ()
106+ {
107+ $ name = 'invalidapiitem ' ;
108+ $ this ->expectException (ClientException::class);
109+ $ this ->expectExceptionMessage ("Não foi possível instanciar a classe: $ name " );
110+ $ this ->client ->$ name ;
111+ }
48112}
0 commit comments