2015-09-10 23:13:48 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @mixin PHPUnit_Framework_TestCase
|
|
|
|
*/
|
2015-11-21 07:18:35 +01:00
|
|
|
class HasFunctionCheckTest extends SapphireTest
|
|
|
|
{
|
|
|
|
public function testCheckReportsMissingFunctions()
|
|
|
|
{
|
|
|
|
$check = new HasFunctionCheck('foo');
|
2015-09-10 23:13:48 +02:00
|
|
|
|
2015-11-21 07:18:35 +01:00
|
|
|
$expected = array(
|
|
|
|
EnvironmentCheck::ERROR,
|
|
|
|
'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 testCheckReportsFoundFunctions()
|
|
|
|
{
|
|
|
|
$check = new HasFunctionCheck('class_exists');
|
2015-09-10 23:13:48 +02:00
|
|
|
|
2015-11-21 07:18:35 +01:00
|
|
|
$expected = array(
|
|
|
|
EnvironmentCheck::OK,
|
|
|
|
'class_exists() 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
|
|
|
}
|