예제 #1
0
 public function testBadData()
 {
     authorizeFromEnv();
     try {
         CleverDistrict::all(array('asdf' => 25));
     } catch (CleverInvalidRequestError $e) {
         $this->assertEquals(400, $e->getHttpStatus());
     }
 }
예제 #2
0
 public function testInvalidCredentials()
 {
     Clever::setApiKey('invalid');
     try {
         CleverDistrict::all();
     } catch (CleverAuthenticationError $e) {
         $this->assertEquals(401, $e->getHttpStatus());
     }
 }
예제 #3
0
 public static function init()
 {
     self::$secondLevelEndpoints = array('schools' => array(), 'teachers' => array(), 'students' => array(), 'sections' => array(), 'events' => array());
 }
예제 #4
0
 /**
  * @expectedException UndefinedEndpointException
  */
 public function testUndefinedSecondLevel()
 {
     $districts = CleverDistrict::all(array('limit' => 1));
     $district = $districts[0];
     $objs = $district->eventz();
 }