silverstripe-environmentcheck/tests/Checks/ExternalURLCheckTest.php

30 lines
736 B
PHP
Raw Normal View History

2015-09-11 09:13:48 +12:00
<?php
namespace SilverStripe\EnvironmentCheck\Tests\Checks;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\EnvironmentCheck\Checks\ExternalURLCheck;
use SilverStripe\EnvironmentCheck\EnvironmentCheck;
2015-09-11 09:13:48 +12:00
/**
* Class ExternalURLCheckTest
*
* @package environmentcheck
2015-09-11 09:13:48 +12:00
*/
2015-11-21 19:18:35 +13:00
class ExternalURLCheckTest extends SapphireTest
{
public function testCheckReportsMissingPages()
{
$this->markTestSkipped('ExternalURLCheck seems faulty on some systems');
2015-09-11 09:13:48 +12:00
2015-11-21 19:18:35 +13:00
$check = new ExternalURLCheck('http://missing-site/');
2015-09-11 09:13:48 +12:00
$expected = [
2015-11-21 19:18:35 +13:00
EnvironmentCheck::ERROR,
'Success retrieving "http://missing-site/" (Code: 404)'
];
2015-09-11 09:13:48 +12:00
2015-11-21 19:18:35 +13:00
$this->assertEquals($expected, $check->check());
}
2015-09-11 09:13:48 +12:00
}