32 lines
671 B
PHP
Raw Normal View History

2015-09-11 09:13:48 +12:00
<?php
/**
* @mixin PHPUnit_Framework_TestCase
*/
2015-11-21 19:18:35 +13:00
class HasClassCheckTest extends SapphireTest
{
public function testCheckReportsMissingClasses()
{
$check = new HasClassCheck('foo');
2015-09-11 09:13:48 +12:00
2015-11-21 19:18:35 +13:00
$expected = array(
EnvironmentCheck::ERROR,
'Class foo doesn\'t exist',
);
2015-09-11 09:13:48 +12:00
2015-11-21 19:18:35 +13:00
$this->assertEquals($expected, $check->check());
}
2015-09-11 09:13:48 +12:00
2015-11-21 19:18:35 +13:00
public function testCheckReportsFoundClasses()
{
$check = new HasClassCheck('stdClass');
2015-09-11 09:13:48 +12:00
2015-11-21 19:18:35 +13:00
$expected = array(
EnvironmentCheck::OK,
'Class stdClass exists',
);
2015-09-11 09:13:48 +12:00
2015-11-21 19:18:35 +13:00
$this->assertEquals($expected, $check->check());
}
2015-09-11 09:13:48 +12:00
}