31 lines
606 B
PHP
31 lines
606 B
PHP
|
<?php
|
||
|
|
||
|
namespace Spark\Plugin;
|
||
|
|
||
|
use SparkPlug;
|
||
|
|
||
|
class PluginManagerTest extends \PhpUnit\Framework\TestCase
|
||
|
{
|
||
|
|
||
|
/**
|
||
|
* @covers PluginManager::registerPlugin
|
||
|
* @covers PluginManager::getPlugin
|
||
|
*/
|
||
|
public function testRegisteringAndFetchingPlugin()
|
||
|
{
|
||
|
$manager = new PluginManager();
|
||
|
|
||
|
$plugin = new TestPlugin();
|
||
|
$manager->registerPlugin('test.testplugin', $plugin);
|
||
|
|
||
|
$gplugin = $manager->getPlugin('test.testplugin');
|
||
|
|
||
|
$this->assertEquals($plugin, $gplugin);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class TestPlugin extends SparkPlug
|
||
|
{
|
||
|
public function load()
|
||
|
{}
|
||
|
}
|