silverstripe-environmentcheck/tests/Checks/URLCheckTest.php

30 lines
638 B
PHP
Raw Normal View History

2015-09-10 23:13:48 +02:00
<?php
namespace SilverStripe\EnvironmentCheck\Tests\Checks;
use SilverStripe\EnvironmentCheck\Checks\URLCheck;
use SilverStripe\EnvironmentCheck\EnvironmentCheck;
use SilverStripe\Dev\SapphireTest;
2015-09-10 23:13:48 +02:00
/**
* Class URLCheckTest
*
2015-09-10 23:13:48 +02:00
* @mixin PHPUnit_Framework_TestCase
*
* @package environmentcheck
2015-09-10 23:13:48 +02:00
*/
2015-11-21 07:18:35 +01:00
class URLCheckTest extends SapphireTest
{
public function testCheckReportsMissingPages()
{
$check = new URLCheck('foo', 'bar');
2015-09-10 23:13:48 +02:00
2015-11-21 07:18:35 +01:00
$expected = array(
EnvironmentCheck::ERROR,
'Error retrieving "foo" (Code: 404)'
2015-11-21 07:18:35 +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
}