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