function authorizeFromEnv() { $apiToken = getenv('CLEVER_API_TOKEN'); if (!$apiToken) { $apiToken = "DEMO_TOKEN"; } Clever::setToken($apiToken); }
public function testInvalidCredentials() { Clever::setApiKey('invalid'); try { CleverDistrict::all(); } catch (CleverAuthenticationError $e) { $this->assertEquals(401, $e->getHttpStatus()); } }
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); } }
public static function setVerifySslCerts($verify) { self::$verifySslCerts = $verify; }
/** * set/change the token after the fact */ function setToken($token) { \Clever::setToken($this->token = $token); }