Projet

Général

Profil

Paste
Télécharger (1011 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / recaptcha / tests / recaptcha_server_status.test @ f76f30e1

1
<?php
2

    
3
/**
4
 * @file
5
 * Contains ReCaptcha.
6
 */
7

    
8
/**
9
 * Test cases for ReCaptcha module UI.
10
 */
11
class ReCaptchaServerStatusTestCase extends ReCaptchaBaseTestCase {
12

    
13
  /**
14
   * Drupal path of the (general) CAPTCHA admin page
15
   */
16
  const RECAPTCHA_ADMIN_PATH = 'admin/config/people/captcha/recaptcha';
17

    
18
  public static function getInfo() {
19
    return array(
20
      'name' => 'ReCaptcha server status cache test',
21
      'group' => 'reCAPTCHA',
22
      'description' => 'Tests reCaptcha admin UI'
23
    );
24
  }
25

    
26
  public function setup() {
27
    parent::setUp();
28
    include_once drupal_get_path('module', 'recaptcha') . '/recaptcha-php-1.11/recaptchalib.php';
29
  }
30

    
31
  public function testServerStatusCache() {
32
    // No cache before status check.
33
    $status_cache = cache_get('recaptcha_server_status');
34
    $this->assertFalse($status_cache);
35

    
36
    // Call status check to set Cache.
37
    _recaptcha_server_is_up();
38

    
39
    $status_cache = cache_get('recaptcha_server_status');
40
    $this->assertNotNull($status_cache);
41
  }
42

    
43
}