mirror of
https://github.com/silverstripe/silverstripe-environmentcheck
synced 2024-10-22 17:05:40 +02:00
b9af2d0734
Remove PHP 5.5 from Travis configuration. Dotenv used for environment management now, examples and tests updated to use putenv instead of define. Logger alias update to LoggerInterface. Update mutable config API calls. Replace array declaration with short version: []. Update license year.
41 lines
825 B
PHP
41 lines
825 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
|
|
*
|
|
* @mixin PHPUnit_Framework_TestCase
|
|
*
|
|
* @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());
|
|
}
|
|
}
|