@@ -5,30 +5,30 @@ |
||
5 | 5 | */ |
6 | 6 | class HasFunctionCheck implements EnvironmentCheck |
7 | 7 | { |
8 | - /** |
|
9 | - * @var string |
|
10 | - */ |
|
11 | - protected $functionName; |
|
8 | + /** |
|
9 | + * @var string |
|
10 | + */ |
|
11 | + protected $functionName; |
|
12 | 12 | |
13 | - /** |
|
14 | - * @param string $functionName The name of the function to look for. |
|
15 | - */ |
|
16 | - public function __construct($functionName) |
|
17 | - { |
|
18 | - $this->functionName = $functionName; |
|
19 | - } |
|
13 | + /** |
|
14 | + * @param string $functionName The name of the function to look for. |
|
15 | + */ |
|
16 | + public function __construct($functionName) |
|
17 | + { |
|
18 | + $this->functionName = $functionName; |
|
19 | + } |
|
20 | 20 | |
21 | - /** |
|
22 | - * @inheritdoc |
|
23 | - * |
|
24 | - * @return array |
|
25 | - */ |
|
26 | - public function check() |
|
27 | - { |
|
28 | - if (function_exists($this->functionName)) { |
|
29 | - return array(EnvironmentCheck::OK, $this->functionName.'() exists'); |
|
30 | - } else { |
|
31 | - return array(EnvironmentCheck::ERROR, $this->functionName.'() doesn\'t exist'); |
|
32 | - } |
|
33 | - } |
|
21 | + /** |
|
22 | + * @inheritdoc |
|
23 | + * |
|
24 | + * @return array |
|
25 | + */ |
|
26 | + public function check() |
|
27 | + { |
|
28 | + if (function_exists($this->functionName)) { |
|
29 | + return array(EnvironmentCheck::OK, $this->functionName.'() exists'); |
|
30 | + } else { |
|
31 | + return array(EnvironmentCheck::ERROR, $this->functionName.'() doesn\'t exist'); |
|
32 | + } |
|
33 | + } |
|
34 | 34 | } |
@@ -7,67 +7,67 @@ |
||
7 | 7 | */ |
8 | 8 | class SMTPConnectCheck implements EnvironmentCheck |
9 | 9 | { |
10 | - /** |
|
11 | - * @var string |
|
12 | - */ |
|
13 | - protected $host; |
|
10 | + /** |
|
11 | + * @var string |
|
12 | + */ |
|
13 | + protected $host; |
|
14 | 14 | |
15 | - /** |
|
16 | - * @var int |
|
17 | - */ |
|
18 | - protected $port; |
|
15 | + /** |
|
16 | + * @var int |
|
17 | + */ |
|
18 | + protected $port; |
|
19 | 19 | |
20 | - /** |
|
21 | - * Timeout (in seconds). |
|
22 | - * |
|
23 | - * @var int |
|
24 | - */ |
|
25 | - protected $timeout; |
|
20 | + /** |
|
21 | + * Timeout (in seconds). |
|
22 | + * |
|
23 | + * @var int |
|
24 | + */ |
|
25 | + protected $timeout; |
|
26 | 26 | |
27 | - /** |
|
28 | - * @param null|string $host |
|
29 | - * @param null|int $port |
|
30 | - * @param int $timeout |
|
31 | - */ |
|
32 | - public function __construct($host = null, $port = null, $timeout = 15) |
|
33 | - { |
|
34 | - $this->host = ($host) ? $host : ini_get('SMTP'); |
|
35 | - if (!$this->host) { |
|
36 | - $this->host = 'localhost'; |
|
37 | - } |
|
27 | + /** |
|
28 | + * @param null|string $host |
|
29 | + * @param null|int $port |
|
30 | + * @param int $timeout |
|
31 | + */ |
|
32 | + public function __construct($host = null, $port = null, $timeout = 15) |
|
33 | + { |
|
34 | + $this->host = ($host) ? $host : ini_get('SMTP'); |
|
35 | + if (!$this->host) { |
|
36 | + $this->host = 'localhost'; |
|
37 | + } |
|
38 | 38 | |
39 | - $this->port = ($port) ? $port : ini_get('smtp_port'); |
|
40 | - if (!$this->port) { |
|
41 | - $this->port = 25; |
|
42 | - } |
|
39 | + $this->port = ($port) ? $port : ini_get('smtp_port'); |
|
40 | + if (!$this->port) { |
|
41 | + $this->port = 25; |
|
42 | + } |
|
43 | 43 | |
44 | - $this->timeout = $timeout; |
|
45 | - } |
|
44 | + $this->timeout = $timeout; |
|
45 | + } |
|
46 | 46 | |
47 | - /** |
|
48 | - * @inheritdoc |
|
49 | - * |
|
50 | - * @return array |
|
51 | - */ |
|
52 | - public function check() |
|
53 | - { |
|
54 | - $f = @fsockopen($this->host, $this->port, $errno, $errstr, $this->timeout); |
|
55 | - if (!$f) { |
|
56 | - return array( |
|
57 | - EnvironmentCheck::ERROR, |
|
58 | - sprintf("Couldn't connect to SMTP on %s:%s (Error: %s %s)", $this->host, $this->port, $errno, $errstr) |
|
59 | - ); |
|
60 | - } |
|
47 | + /** |
|
48 | + * @inheritdoc |
|
49 | + * |
|
50 | + * @return array |
|
51 | + */ |
|
52 | + public function check() |
|
53 | + { |
|
54 | + $f = @fsockopen($this->host, $this->port, $errno, $errstr, $this->timeout); |
|
55 | + if (!$f) { |
|
56 | + return array( |
|
57 | + EnvironmentCheck::ERROR, |
|
58 | + sprintf("Couldn't connect to SMTP on %s:%s (Error: %s %s)", $this->host, $this->port, $errno, $errstr) |
|
59 | + ); |
|
60 | + } |
|
61 | 61 | |
62 | - fwrite($f, "HELO its_me\r\n"); |
|
63 | - $response = fread($f, 26); |
|
64 | - if (substr($response, 0, 3) != '220') { |
|
65 | - return array( |
|
66 | - EnvironmentCheck::ERROR, |
|
67 | - sprintf("Invalid mail server response: %s", $response) |
|
68 | - ); |
|
69 | - } |
|
62 | + fwrite($f, "HELO its_me\r\n"); |
|
63 | + $response = fread($f, 26); |
|
64 | + if (substr($response, 0, 3) != '220') { |
|
65 | + return array( |
|
66 | + EnvironmentCheck::ERROR, |
|
67 | + sprintf("Invalid mail server response: %s", $response) |
|
68 | + ); |
|
69 | + } |
|
70 | 70 | |
71 | - return array(EnvironmentCheck::OK, ''); |
|
72 | - } |
|
71 | + return array(EnvironmentCheck::OK, ''); |
|
72 | + } |
|
73 | 73 | } |
@@ -7,50 +7,50 @@ |
||
7 | 7 | */ |
8 | 8 | class SolrIndexCheck implements EnvironmentCheck |
9 | 9 | { |
10 | - /** |
|
11 | - * @var null|string |
|
12 | - */ |
|
13 | - protected $indexClass; |
|
10 | + /** |
|
11 | + * @var null|string |
|
12 | + */ |
|
13 | + protected $indexClass; |
|
14 | 14 | |
15 | - /** |
|
16 | - * @param string $indexClass Limit the index checks to the specified class and all its subclasses. |
|
17 | - */ |
|
18 | - public function __construct($indexClass = null) |
|
19 | - { |
|
20 | - $this->indexClass = $indexClass; |
|
21 | - } |
|
15 | + /** |
|
16 | + * @param string $indexClass Limit the index checks to the specified class and all its subclasses. |
|
17 | + */ |
|
18 | + public function __construct($indexClass = null) |
|
19 | + { |
|
20 | + $this->indexClass = $indexClass; |
|
21 | + } |
|
22 | 22 | |
23 | - /** |
|
24 | - * @inheritdoc |
|
25 | - * |
|
26 | - * @return array |
|
27 | - */ |
|
28 | - public function check() |
|
29 | - { |
|
30 | - $brokenCores = array(); |
|
23 | + /** |
|
24 | + * @inheritdoc |
|
25 | + * |
|
26 | + * @return array |
|
27 | + */ |
|
28 | + public function check() |
|
29 | + { |
|
30 | + $brokenCores = array(); |
|
31 | 31 | |
32 | - if (!class_exists('Solr')) { |
|
33 | - return array( |
|
34 | - EnvironmentCheck::ERROR, |
|
35 | - 'Class `Solr` not found. Is the fulltextsearch module installed?' |
|
36 | - ); |
|
37 | - } |
|
32 | + if (!class_exists('Solr')) { |
|
33 | + return array( |
|
34 | + EnvironmentCheck::ERROR, |
|
35 | + 'Class `Solr` not found. Is the fulltextsearch module installed?' |
|
36 | + ); |
|
37 | + } |
|
38 | 38 | |
39 | - $service = Solr::service(); |
|
40 | - foreach (Solr::get_indexes($this->indexClass) as $index) { |
|
41 | - $core = $index->getIndexName(); |
|
42 | - if (!$service->coreIsActive($core)) { |
|
43 | - $brokenCores[] = $core; |
|
44 | - } |
|
45 | - } |
|
39 | + $service = Solr::service(); |
|
40 | + foreach (Solr::get_indexes($this->indexClass) as $index) { |
|
41 | + $core = $index->getIndexName(); |
|
42 | + if (!$service->coreIsActive($core)) { |
|
43 | + $brokenCores[] = $core; |
|
44 | + } |
|
45 | + } |
|
46 | 46 | |
47 | - if (!empty($brokenCores)) { |
|
48 | - return array( |
|
49 | - EnvironmentCheck::ERROR, |
|
50 | - 'The following indexes are unavailable: ' . implode($brokenCores, ', ') |
|
51 | - ); |
|
52 | - } |
|
47 | + if (!empty($brokenCores)) { |
|
48 | + return array( |
|
49 | + EnvironmentCheck::ERROR, |
|
50 | + 'The following indexes are unavailable: ' . implode($brokenCores, ', ') |
|
51 | + ); |
|
52 | + } |
|
53 | 53 | |
54 | - return array(EnvironmentCheck::OK, 'Expected indexes are available.'); |
|
55 | - } |
|
54 | + return array(EnvironmentCheck::OK, 'Expected indexes are available.'); |
|
55 | + } |
|
56 | 56 | } |
@@ -7,52 +7,52 @@ |
||
7 | 7 | */ |
8 | 8 | class URLCheck implements EnvironmentCheck |
9 | 9 | { |
10 | - /** |
|
11 | - * @var string |
|
12 | - */ |
|
13 | - protected $url; |
|
10 | + /** |
|
11 | + * @var string |
|
12 | + */ |
|
13 | + protected $url; |
|
14 | 14 | |
15 | - /** |
|
16 | - * @var string |
|
17 | - */ |
|
18 | - protected $testString; |
|
15 | + /** |
|
16 | + * @var string |
|
17 | + */ |
|
18 | + protected $testString; |
|
19 | 19 | |
20 | - /* |
|
20 | + /* |
|
21 | 21 | * @param string $url The URL to check, relative to the site (homepage is ''). |
22 | 22 | * @param string $testString An optional piece of text to search for on the homepage. |
23 | 23 | */ |
24 | - public function __construct($url = '', $testString = '') |
|
25 | - { |
|
26 | - $this->url = $url; |
|
27 | - $this->testString = $testString; |
|
28 | - } |
|
24 | + public function __construct($url = '', $testString = '') |
|
25 | + { |
|
26 | + $this->url = $url; |
|
27 | + $this->testString = $testString; |
|
28 | + } |
|
29 | 29 | |
30 | - /** |
|
31 | - * @inheritdoc |
|
32 | - * |
|
33 | - * @return array |
|
34 | - * |
|
35 | - * @throws SS_HTTPResponse_Exception |
|
36 | - */ |
|
37 | - public function check() |
|
38 | - { |
|
39 | - $response = Director::test($this->url); |
|
30 | + /** |
|
31 | + * @inheritdoc |
|
32 | + * |
|
33 | + * @return array |
|
34 | + * |
|
35 | + * @throws SS_HTTPResponse_Exception |
|
36 | + */ |
|
37 | + public function check() |
|
38 | + { |
|
39 | + $response = Director::test($this->url); |
|
40 | 40 | |
41 | - if ($response->getStatusCode() != 200) { |
|
42 | - return array( |
|
43 | - EnvironmentCheck::ERROR, |
|
44 | - sprintf('Error retrieving "%s" (Code: %d)', $this->url, $response->getStatusCode()) |
|
45 | - ); |
|
46 | - } elseif ($this->testString && (strpos($response->getBody(), $this->testString) === false)) { |
|
47 | - return array( |
|
48 | - EnvironmentCheck::WARNING, |
|
49 | - sprintf('Success retrieving "%s", but string "%s" not found', $this->url, $this->testString) |
|
50 | - ); |
|
51 | - } else { |
|
52 | - return array( |
|
53 | - EnvironmentCheck::OK, |
|
54 | - sprintf('Success retrieving "%s"', $this->url) |
|
55 | - ); |
|
56 | - } |
|
57 | - } |
|
41 | + if ($response->getStatusCode() != 200) { |
|
42 | + return array( |
|
43 | + EnvironmentCheck::ERROR, |
|
44 | + sprintf('Error retrieving "%s" (Code: %d)', $this->url, $response->getStatusCode()) |
|
45 | + ); |
|
46 | + } elseif ($this->testString && (strpos($response->getBody(), $this->testString) === false)) { |
|
47 | + return array( |
|
48 | + EnvironmentCheck::WARNING, |
|
49 | + sprintf('Success retrieving "%s", but string "%s" not found', $this->url, $this->testString) |
|
50 | + ); |
|
51 | + } else { |
|
52 | + return array( |
|
53 | + EnvironmentCheck::OK, |
|
54 | + sprintf('Success retrieving "%s"', $this->url) |
|
55 | + ); |
|
56 | + } |
|
57 | + } |
|
58 | 58 | } |
@@ -5,12 +5,12 @@ |
||
5 | 5 | */ |
6 | 6 | class DevCheckControllerTest extends SapphireTest |
7 | 7 | { |
8 | - public function testIndexCreatesChecker() |
|
9 | - { |
|
10 | - $controller = new DevCheckController(); |
|
8 | + public function testIndexCreatesChecker() |
|
9 | + { |
|
10 | + $controller = new DevCheckController(); |
|
11 | 11 | |
12 | - $request = new SS_HTTPRequest('GET', 'example.com'); |
|
12 | + $request = new SS_HTTPRequest('GET', 'example.com'); |
|
13 | 13 | |
14 | - $this->assertInstanceOf('EnvironmentChecker', $controller->index($request)); |
|
15 | - } |
|
14 | + $this->assertInstanceOf('EnvironmentChecker', $controller->index($request)); |
|
15 | + } |
|
16 | 16 | } |
@@ -5,21 +5,21 @@ |
||
5 | 5 | */ |
6 | 6 | class DevHealthControllerTest extends SapphireTest |
7 | 7 | { |
8 | - public function testIndexCreatesChecker() |
|
9 | - { |
|
10 | - $controller = new DevHealthController(); |
|
8 | + public function testIndexCreatesChecker() |
|
9 | + { |
|
10 | + $controller = new DevHealthController(); |
|
11 | 11 | |
12 | - $request = new SS_HTTPRequest('GET', 'example.com'); |
|
12 | + $request = new SS_HTTPRequest('GET', 'example.com'); |
|
13 | 13 | |
14 | - // we need to fake authenticated access as BasicAuth::requireLogin doesn't like empty |
|
15 | - // permission type strings, which is what health check uses. |
|
14 | + // we need to fake authenticated access as BasicAuth::requireLogin doesn't like empty |
|
15 | + // permission type strings, which is what health check uses. |
|
16 | 16 | |
17 | - define('ENVCHECK_BASICAUTH_USERNAME', 'foo'); |
|
18 | - define('ENVCHECK_BASICAUTH_PASSWORD', 'bar'); |
|
17 | + define('ENVCHECK_BASICAUTH_USERNAME', 'foo'); |
|
18 | + define('ENVCHECK_BASICAUTH_PASSWORD', 'bar'); |
|
19 | 19 | |
20 | - $_SERVER['PHP_AUTH_USER'] = 'foo'; |
|
21 | - $_SERVER['PHP_AUTH_PW'] = 'bar'; |
|
20 | + $_SERVER['PHP_AUTH_USER'] = 'foo'; |
|
21 | + $_SERVER['PHP_AUTH_PW'] = 'bar'; |
|
22 | 22 | |
23 | - $this->assertInstanceOf('EnvironmentChecker', $controller->index($request)); |
|
24 | - } |
|
23 | + $this->assertInstanceOf('EnvironmentChecker', $controller->index($request)); |
|
24 | + } |
|
25 | 25 | } |
@@ -1,100 +1,100 @@ |
||
1 | 1 | <?php |
2 | 2 | class EnvironmentCheckerTest extends SapphireTest |
3 | 3 | { |
4 | - public function setUpOnce() |
|
5 | - { |
|
6 | - parent::setUpOnce(); |
|
4 | + public function setUpOnce() |
|
5 | + { |
|
6 | + parent::setUpOnce(); |
|
7 | 7 | |
8 | - Phockito::include_hamcrest(); |
|
9 | - } |
|
8 | + Phockito::include_hamcrest(); |
|
9 | + } |
|
10 | 10 | |
11 | - public function setUp() |
|
12 | - { |
|
13 | - parent::setUp(); |
|
11 | + public function setUp() |
|
12 | + { |
|
13 | + parent::setUp(); |
|
14 | 14 | |
15 | - Config::nest(); |
|
16 | - } |
|
15 | + Config::nest(); |
|
16 | + } |
|
17 | 17 | |
18 | - public function tearDown() |
|
19 | - { |
|
20 | - Config::unnest(); |
|
18 | + public function tearDown() |
|
19 | + { |
|
20 | + Config::unnest(); |
|
21 | 21 | |
22 | - parent::tearDown(); |
|
23 | - } |
|
22 | + parent::tearDown(); |
|
23 | + } |
|
24 | 24 | |
25 | - public function testOnlyLogsWithErrors() |
|
26 | - { |
|
27 | - Config::inst()->update('EnvironmentChecker', 'log_results_warning', true); |
|
28 | - Config::inst()->update('EnvironmentChecker', 'log_results_error', true); |
|
29 | - EnvironmentCheckSuite::register('test suite', new EnvironmentCheckerTest_CheckNoErrors()); |
|
30 | - $checker = Phockito::spy( |
|
31 | - 'EnvironmentChecker', |
|
32 | - 'test suite', |
|
33 | - 'test' |
|
34 | - ); |
|
25 | + public function testOnlyLogsWithErrors() |
|
26 | + { |
|
27 | + Config::inst()->update('EnvironmentChecker', 'log_results_warning', true); |
|
28 | + Config::inst()->update('EnvironmentChecker', 'log_results_error', true); |
|
29 | + EnvironmentCheckSuite::register('test suite', new EnvironmentCheckerTest_CheckNoErrors()); |
|
30 | + $checker = Phockito::spy( |
|
31 | + 'EnvironmentChecker', |
|
32 | + 'test suite', |
|
33 | + 'test' |
|
34 | + ); |
|
35 | 35 | |
36 | - $response = $checker->index(); |
|
37 | - Phockito::verify($checker, 0)->log(anything(), anything()); |
|
38 | - EnvironmentCheckSuite::reset(); |
|
39 | - } |
|
36 | + $response = $checker->index(); |
|
37 | + Phockito::verify($checker, 0)->log(anything(), anything()); |
|
38 | + EnvironmentCheckSuite::reset(); |
|
39 | + } |
|
40 | 40 | |
41 | - public function testLogsWithWarnings() |
|
42 | - { |
|
43 | - Config::inst()->update('EnvironmentChecker', 'log_results_warning', true); |
|
44 | - Config::inst()->update('EnvironmentChecker', 'log_results_error', false); |
|
45 | - EnvironmentCheckSuite::register('test suite', new EnvironmentCheckerTest_CheckWarnings()); |
|
46 | - EnvironmentCheckSuite::register('test suite', new EnvironmentCheckerTest_CheckErrors()); |
|
47 | - $checker = Phockito::spy( |
|
48 | - 'EnvironmentChecker', |
|
49 | - 'test suite', |
|
50 | - 'test' |
|
51 | - ); |
|
41 | + public function testLogsWithWarnings() |
|
42 | + { |
|
43 | + Config::inst()->update('EnvironmentChecker', 'log_results_warning', true); |
|
44 | + Config::inst()->update('EnvironmentChecker', 'log_results_error', false); |
|
45 | + EnvironmentCheckSuite::register('test suite', new EnvironmentCheckerTest_CheckWarnings()); |
|
46 | + EnvironmentCheckSuite::register('test suite', new EnvironmentCheckerTest_CheckErrors()); |
|
47 | + $checker = Phockito::spy( |
|
48 | + 'EnvironmentChecker', |
|
49 | + 'test suite', |
|
50 | + 'test' |
|
51 | + ); |
|
52 | 52 | |
53 | - $response = $checker->index(); |
|
54 | - Phockito::verify($checker, 1)->log(containsString('warning'), anything()); |
|
55 | - Phockito::verify($checker, 0)->log(containsString('error'), anything()); |
|
56 | - EnvironmentCheckSuite::reset(); |
|
57 | - } |
|
53 | + $response = $checker->index(); |
|
54 | + Phockito::verify($checker, 1)->log(containsString('warning'), anything()); |
|
55 | + Phockito::verify($checker, 0)->log(containsString('error'), anything()); |
|
56 | + EnvironmentCheckSuite::reset(); |
|
57 | + } |
|
58 | 58 | |
59 | - public function testLogsWithErrors() |
|
60 | - { |
|
61 | - Config::inst()->update('EnvironmentChecker', 'log_results_error', false); |
|
62 | - Config::inst()->update('EnvironmentChecker', 'log_results_error', true); |
|
63 | - EnvironmentCheckSuite::register('test suite', new EnvironmentCheckerTest_CheckWarnings()); |
|
64 | - EnvironmentCheckSuite::register('test suite', new EnvironmentCheckerTest_CheckErrors()); |
|
65 | - $checker = Phockito::spy( |
|
66 | - 'EnvironmentChecker', |
|
67 | - 'test suite', |
|
68 | - 'test' |
|
69 | - ); |
|
59 | + public function testLogsWithErrors() |
|
60 | + { |
|
61 | + Config::inst()->update('EnvironmentChecker', 'log_results_error', false); |
|
62 | + Config::inst()->update('EnvironmentChecker', 'log_results_error', true); |
|
63 | + EnvironmentCheckSuite::register('test suite', new EnvironmentCheckerTest_CheckWarnings()); |
|
64 | + EnvironmentCheckSuite::register('test suite', new EnvironmentCheckerTest_CheckErrors()); |
|
65 | + $checker = Phockito::spy( |
|
66 | + 'EnvironmentChecker', |
|
67 | + 'test suite', |
|
68 | + 'test' |
|
69 | + ); |
|
70 | 70 | |
71 | - $response = $checker->index(); |
|
72 | - Phockito::verify($checker, 0)->log(containsString('warning'), anything()); |
|
73 | - Phockito::verify($checker, 1)->log(containsString('error'), anything()); |
|
74 | - EnvironmentCheckSuite::reset(); |
|
75 | - } |
|
71 | + $response = $checker->index(); |
|
72 | + Phockito::verify($checker, 0)->log(containsString('warning'), anything()); |
|
73 | + Phockito::verify($checker, 1)->log(containsString('error'), anything()); |
|
74 | + EnvironmentCheckSuite::reset(); |
|
75 | + } |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | class EnvironmentCheckerTest_CheckNoErrors implements EnvironmentCheck, TestOnly |
79 | 79 | { |
80 | - public function check() |
|
81 | - { |
|
82 | - return array(EnvironmentCheck::OK, ''); |
|
83 | - } |
|
80 | + public function check() |
|
81 | + { |
|
82 | + return array(EnvironmentCheck::OK, ''); |
|
83 | + } |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | class EnvironmentCheckerTest_CheckWarnings implements EnvironmentCheck, TestOnly |
87 | 87 | { |
88 | - public function check() |
|
89 | - { |
|
90 | - return array(EnvironmentCheck::WARNING, "test warning"); |
|
91 | - } |
|
88 | + public function check() |
|
89 | + { |
|
90 | + return array(EnvironmentCheck::WARNING, "test warning"); |
|
91 | + } |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | class EnvironmentCheckerTest_CheckErrors implements EnvironmentCheck, TestOnly |
95 | 95 | { |
96 | - public function check() |
|
97 | - { |
|
98 | - return array(EnvironmentCheck::ERROR, "test error"); |
|
99 | - } |
|
96 | + public function check() |
|
97 | + { |
|
98 | + return array(EnvironmentCheck::ERROR, "test error"); |
|
99 | + } |
|
100 | 100 | } |
@@ -5,15 +5,15 @@ |
||
5 | 5 | */ |
6 | 6 | class DatabaseCheckTest extends SapphireTest |
7 | 7 | { |
8 | - public function testCheckReportsValidConnection() |
|
9 | - { |
|
10 | - $check = new DatabaseCheck(); |
|
8 | + public function testCheckReportsValidConnection() |
|
9 | + { |
|
10 | + $check = new DatabaseCheck(); |
|
11 | 11 | |
12 | - $expected = array( |
|
13 | - EnvironmentCheck::OK, |
|
14 | - '', |
|
15 | - ); |
|
12 | + $expected = array( |
|
13 | + EnvironmentCheck::OK, |
|
14 | + '', |
|
15 | + ); |
|
16 | 16 | |
17 | - $this->assertEquals($expected, $check->check()); |
|
18 | - } |
|
17 | + $this->assertEquals($expected, $check->check()); |
|
18 | + } |
|
19 | 19 | } |
@@ -5,17 +5,17 @@ |
||
5 | 5 | */ |
6 | 6 | class ExternalURLCheckTest extends SapphireTest |
7 | 7 | { |
8 | - public function testCheckReportsMissingPages() |
|
9 | - { |
|
10 | - $this->markTestSkipped('ExternalURLCheck seems faulty on some systems'); |
|
8 | + public function testCheckReportsMissingPages() |
|
9 | + { |
|
10 | + $this->markTestSkipped('ExternalURLCheck seems faulty on some systems'); |
|
11 | 11 | |
12 | - $check = new ExternalURLCheck('http://missing-site/'); |
|
12 | + $check = new ExternalURLCheck('http://missing-site/'); |
|
13 | 13 | |
14 | - $expected = array( |
|
15 | - EnvironmentCheck::ERROR, |
|
16 | - 'Success retrieving "http://missing-site/" (Code: 404)', |
|
17 | - ); |
|
14 | + $expected = array( |
|
15 | + EnvironmentCheck::ERROR, |
|
16 | + 'Success retrieving "http://missing-site/" (Code: 404)', |
|
17 | + ); |
|
18 | 18 | |
19 | - $this->assertEquals($expected, $check->check()); |
|
20 | - } |
|
19 | + $this->assertEquals($expected, $check->check()); |
|
20 | + } |
|
21 | 21 | } |