php-spark/tests/Plugin/PluginManagerTest.php

31 lines
606 B
PHP
Raw Permalink Normal View History

2021-12-23 14:44:02 +00:00
<?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()
{}
}