php-spark/tests/Resource/ResourceManagerTest.php

27 lines
532 B
PHP
Raw Normal View History

<?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()
{
}
}