2017-01-04 23:16:12 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\EnvironmentCheck\Tests\Controllers;
|
|
|
|
|
|
|
|
use SilverStripe\Control\HTTPRequest;
|
|
|
|
use SilverStripe\Dev\SapphireTest;
|
|
|
|
use SilverStripe\EnvironmentCheck\Controllers\DevCheckController;
|
2017-03-21 11:57:07 +01:00
|
|
|
use SilverStripe\EnvironmentCheck\EnvironmentChecker;
|
2017-01-04 23:16:12 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class DevCheckControllerTest
|
|
|
|
*
|
|
|
|
* @package environmentcheck
|
|
|
|
*/
|
|
|
|
class DevCheckControllerTest extends SapphireTest
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* {@inheritDoc}
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $usesDatabase = true;
|
|
|
|
|
|
|
|
public function testIndexCreatesChecker()
|
|
|
|
{
|
|
|
|
$controller = new DevCheckController();
|
|
|
|
|
|
|
|
$request = new HTTPRequest('GET', 'example.com');
|
|
|
|
|
2017-03-21 11:57:07 +01:00
|
|
|
$this->assertInstanceOf(EnvironmentChecker::class, $controller->index($request));
|
2017-01-04 23:16:12 +01:00
|
|
|
}
|
2022-07-01 05:13:27 +02:00
|
|
|
|
|
|
|
public function testCheckIncludesDetails()
|
|
|
|
{
|
|
|
|
$controller = new DevCheckController();
|
|
|
|
$request = new HTTPRequest('GET', 'example.com');
|
|
|
|
|
|
|
|
$response = $controller->index($request)->index();
|
|
|
|
|
|
|
|
$this->assertStringContainsString('<table>', $response->getBody());
|
|
|
|
}
|
2017-01-04 23:16:12 +01:00
|
|
|
}
|