silverstripe-environmentcheck/tests/checks/HasClassCheckTest.php

32 lines
671 B
PHP
Raw Normal View History

2015-09-10 23:13:48 +02:00
<?php
/**
* @mixin PHPUnit_Framework_TestCase
*/
2015-11-21 07:18:35 +01:00
class HasClassCheckTest extends SapphireTest
{
public function testCheckReportsMissingClasses()
{
$check = new HasClassCheck('foo');
2015-09-10 23:13:48 +02:00
2015-11-21 07:18:35 +01:00
$expected = array(
EnvironmentCheck::ERROR,
'Class foo doesn\'t exist',
);
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
2015-11-21 07:18:35 +01:00
public function testCheckReportsFoundClasses()
{
$check = new HasClassCheck('stdClass');
2015-09-10 23:13:48 +02:00
2015-11-21 07:18:35 +01:00
$expected = array(
EnvironmentCheck::OK,
'Class stdClass exists',
);
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
}