mirror of
https://github.com/silverstripe/silverstripe-environmentcheck
synced 2024-10-22 17:05:40 +02:00
29 lines
572 B
PHP
29 lines
572 B
PHP
|
<?php
|
||
|
|
||
|
/**
|
||
|
* @mixin PHPUnit_Framework_TestCase
|
||
|
*/
|
||
|
class HasFunctionCheckTest extends SapphireTest {
|
||
|
public function testCheckReportsMissingFunctions() {
|
||
|
$check = new HasFunctionCheck('foo');
|
||
|
|
||
|
$expected = array(
|
||
|
EnvironmentCheck::ERROR,
|
||
|
'foo() doesn\'t exist',
|
||
|
);
|
||
|
|
||
|
$this->assertEquals($expected, $check->check());
|
||
|
}
|
||
|
|
||
|
public function testCheckReportsFoundFunctions() {
|
||
|
$check = new HasFunctionCheck('class_exists');
|
||
|
|
||
|
$expected = array(
|
||
|
EnvironmentCheck::OK,
|
||
|
'class_exists() exists',
|
||
|
);
|
||
|
|
||
|
$this->assertEquals($expected, $check->check());
|
||
|
}
|
||
|
}
|