27 lines
532 B
PHP
27 lines
532 B
PHP
|
<?php
|
||
|
|
||
|
namespace Spark\Resource;
|
||
|
|
||
|
|
||
|
class ResourceManagerTest extends \PhpUnit\Framework\TestCase
|
||
|
{
|
||
|
/**
|
||
|
* @covers ResourceManager::registerResourceType
|
||
|
*/
|
||
|
public function testRegisteringResourceTypes()
|
||
|
{
|
||
|
$manager = new ResourceManager();
|
||
|
$manager->registerResourceType('foo', FooType::class);
|
||
|
|
||
|
$types = $manager->getAllResourceTypes();
|
||
|
$this->assertEquals( ['foo'=>FooType::class], $types );
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class FooType extends ResourceType
|
||
|
{
|
||
|
public function info()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
}
|