silverstripe-environmentcheck/tests/Checks/HasClassCheckTest.php
Robbie Averill b9af2d0734 FIX Update config API, Logger alias, dotenv config, remove PHP 5.5, other fixes
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.
2017-05-04 16:11:25 +12:00

42 lines
913 B
PHP

<?php
namespace SilverStripe\EnvironmentCheck\Tests\Checks;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\EnvironmentCheck\Checks\HasClassCheck;
use SilverStripe\EnvironmentCheck\EnvironmentCheck;
/**
* Class HasClassCheckTest
*
* @mixin PHPUnit_Framework_TestCase
*
* @package environmentcheck
*/
class HasClassCheckTest extends SapphireTest
{
public function testCheckReportsMissingClasses()
{
$check = new HasClassCheck('foo');
$expected = [
EnvironmentCheck::ERROR,
'Class foo doesn\'t exist'
];
$this->assertEquals($expected, $check->check());
}
public function testCheckReportsFoundClasses()
{
$check = new HasClassCheck('stdClass');
$expected = [
EnvironmentCheck::OK,
'Class stdClass exists',
];
$this->assertEquals($expected, $check->check());
}
}