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
|
/**
|
19
|
*
|
20
|
*/
|
21
|
public static function getInfo() {
|
22
|
return array(
|
23
|
'name' => 'ReCaptcha server status cache test',
|
24
|
'group' => 'reCAPTCHA',
|
25
|
'description' => 'Tests reCaptcha admin UI',
|
26
|
);
|
27
|
}
|
28
|
|
29
|
/**
|
30
|
*
|
31
|
*/
|
32
|
public function setup() {
|
33
|
parent::setUp();
|
34
|
include_once drupal_get_path('module', 'recaptcha') . '/recaptcha-php-1.11/recaptchalib.php';
|
35
|
}
|
36
|
|
37
|
/**
|
38
|
*
|
39
|
*/
|
40
|
public function testServerStatusCache() {
|
41
|
// No cache before status check.
|
42
|
$status_cache = cache_get('recaptcha_server_status');
|
43
|
$this->assertFalse($status_cache);
|
44
|
|
45
|
// Call status check to set Cache.
|
46
|
_recaptcha_server_is_up();
|
47
|
|
48
|
$status_cache = cache_get('recaptcha_server_status');
|
49
|
$this->assertNotNull($status_cache);
|
50
|
}
|
51
|
|
52
|
}
|