human friendly name for bundles (#1491)
This commit is contained in:
@@ -30,11 +30,11 @@ class PluginCommandTest extends KernelTestCase
|
||||
public function testWithPlugins()
|
||||
{
|
||||
$plugin1 = $this->getMockBuilder(PluginInterface::class)->onlyMethods(['getName', 'getPath'])->getMock();
|
||||
$plugin1->expects($this->exactly(3))->method('getName')->willReturn('Test-Bundle');
|
||||
$plugin1->expects($this->any())->method('getName')->willReturn('Test-Bundle');
|
||||
$plugin1->expects($this->once())->method('getPath')->willReturn(__DIR__);
|
||||
|
||||
$plugin2 = $this->getMockBuilder(PluginInterface::class)->onlyMethods(['getName', 'getPath'])->getMock();
|
||||
$plugin2->expects($this->exactly(3))->method('getName')->willReturn('Another one');
|
||||
$plugin2->expects($this->any())->method('getName')->willReturn('Another one');
|
||||
$plugin2->expects($this->once())->method('getPath')->willReturn('BundleDirectory');
|
||||
|
||||
$commandTester = $this->getCommandTester([$plugin1, $plugin2], []);
|
||||
|
||||
@@ -72,6 +72,8 @@ class PluginManagerTest extends TestCase
|
||||
$meta = $plugin->getMetadata();
|
||||
$this->assertEquals('0.9', $meta->getKimaiVersion());
|
||||
$this->assertEquals('1.0', $meta->getVersion());
|
||||
$this->assertEquals('TestPlugin', $plugin->getId());
|
||||
$this->assertEquals('TestPlugin from composer.json', $plugin->getName());
|
||||
$this->assertEquals('Just a test fixture for the PluginManager', $meta->getDescription());
|
||||
$this->assertEquals('https://github.com/kevinpapst/kimai2', $meta->getHomepage());
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ class PluginTest extends TestCase
|
||||
public function testEmptyObject()
|
||||
{
|
||||
$plugin = new Plugin();
|
||||
$this->assertNull($plugin->getId());
|
||||
$this->assertNull($plugin->getName());
|
||||
$this->assertNull($plugin->getPath());
|
||||
$this->assertNull($plugin->getMetadata());
|
||||
@@ -37,10 +38,12 @@ class PluginTest extends TestCase
|
||||
;
|
||||
|
||||
$plugin = new Plugin();
|
||||
$this->assertInstanceOf(Plugin::class, $plugin->setId('foo2'));
|
||||
$this->assertInstanceOf(Plugin::class, $plugin->setName('foo'));
|
||||
$this->assertInstanceOf(Plugin::class, $plugin->setPath('bar'));
|
||||
$this->assertInstanceOf(Plugin::class, $plugin->setMetadata($metadata));
|
||||
|
||||
$this->assertEquals('foo2', $plugin->getId());
|
||||
$this->assertEquals('foo', $plugin->getName());
|
||||
$this->assertEquals('bar', $plugin->getPath());
|
||||
$this->assertSame($metadata, $plugin->getMetadata());
|
||||
|
||||
Reference in New Issue
Block a user