File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,18 @@ public function setUp()
15
15
$ this ->sdk = new SDK (['api_key ' => $ this ->config ['api_key ' ], 'summary_length ' => 5 ]);
16
16
}
17
17
18
+ public function testApiKeyIsInvalid ()
19
+ {
20
+ $ sdk = $ this ->sdk = new SDK (['api_key ' => 'INVALID1J3243N090 ' , 'summary_length ' => 5 ]);
21
+ $ response = $ sdk ->summarizeText ($ this ->getTextToSummarize ());
22
+
23
+ $ this ->assertInstanceOf ('stdClass ' , $ response );
24
+ $ this ->assertObjectHasAttribute ('sm_api_error ' , $ response );
25
+ $ this ->assertObjectHasAttribute ('sm_api_message ' , $ response );
26
+ $ this ->assertEquals (1 , $ response ->sm_api_error );
27
+ $ this ->assertEquals ('INVALID API KEY ' , $ response ->sm_api_message );
28
+ }
29
+
18
30
public function testSummarizesExpectedText ()
19
31
{
20
32
$ response = $ this ->sdk ->summarizeText ($ this ->getTextToSummarize ());
You can’t perform that action at this time.
0 commit comments