public function testInvalidCredentials()
 {
     Clever::setApiKey('invalid');
     try {
         CleverDistrict::all();
     } catch (CleverAuthenticationError $e) {
         $this->assertEquals(401, $e->getHttpStatus());
     }
 }
示例#2
0
 public function testToken()
 {
     Clever::setApiKey(null);
     // Unset any apiKey
     Clever::setToken('DEMO_TOKEN');
     $schools = CleverSchool::all();
     foreach ($schools as $school) {
         $this->assertEquals(get_class($school), "CleverSchool");
         $this->assertEquals($school->instanceUrl(), "/schools/" . $school->id);
         $schoolBefore = clone $school;
         $school->refresh();
         $this->assertEquals($schoolBefore, $school);
     }
 }