public function testApiAuthKeyBadKey()
 {
     global $CONFIG;
     $CONFIG->input['api_key'] = 'BAD';
     try {
         api_auth_key();
         $this->assertTrue(FALSE);
     } catch (Exception $e) {
         $this->assertIsA($e, 'APIException');
         $this->assertIdentical($e->getMessage(), elgg_echo('APIException:BadAPIKey'));
     }
 }
Example #2
0
 public function testApiAuthKeyBadKey()
 {
     set_input('api_key', 'BAD');
     try {
         api_auth_key();
         $this->assertTrue(FALSE);
     } catch (Exception $e) {
         $this->assertIsA($e, 'APIException');
         $this->assertIdentical($e->getMessage(), elgg_echo('APIException:BadAPIKey'));
     }
 }