Small test for Load::setExclude

This commit is contained in:
Anton Terekhov
2012-11-21 21:34:09 +04:00
parent f7b6837b91
commit 2ee61dc42c

View File

@ -170,6 +170,23 @@ class LoadTest extends PHPUnit_Framework_TestCase
Load::autoload('DbDriver');
}
/**
* @runInSeparateProcess
*/
public function testSetExclude()
{
$reflection_prop = new ReflectionProperty('Load', 'exclude');
$reflection_prop->setAccessible(true);
$this->assertCount(0, $reflection_prop->getValue('Load'));
Load::setExclude('dir1');
$this->assertCount(1, $reflection_prop->getValue('Load'));
Load::setExclude(array('dir2'));
$this->assertCount(2, $reflection_prop->getValue('Load'));
$this->assertSame(array('dir1', 'dir2'), $reflection_prop->getValue('Load'));
}
protected function newCallback($className)
{