silverstripe-environmentcheck/tests/Checks/DatabaseCheckTest.php
2021-10-27 18:06:29 +13:00

39 lines
785 B
PHP

<?php
namespace SilverStripe\EnvironmentCheck\Tests\Checks;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\EnvironmentCheck\Checks\DatabaseCheck;
use SilverStripe\EnvironmentCheck\EnvironmentCheck;
use SilverStripe\Security\Member;
/**
* Class DatabaseCheckTest
*
* @package environmentcheck
*/
class DatabaseCheckTest extends SapphireTest
{
/**
* {@inheritDoc}
* @var bool
*/
protected $usesDatabase = true;
public function testCheckReportsValidConnection()
{
$member = new Member;
$member->FirstName = 'Bob';
$member->write();
$check = new DatabaseCheck();
$expected = [
EnvironmentCheck::OK,
''
];
$this->assertEquals($expected, $check->check());
}
}