added plugin screen (#671)

This commit is contained in:
Kevin Papst
2019-04-08 18:38:56 +02:00
committed by GitHub
parent 5bea9915f5
commit 3a4aa5a001
68 changed files with 1392 additions and 490 deletions

View File

@@ -0,0 +1,48 @@
<?php
/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Tests\Plugin;
use App\Plugin\Plugin;
use App\Plugin\PluginMetadata;
use PHPUnit\Framework\TestCase;
/**
* @covers \App\Plugin\Plugin
*/
class PluginTest extends TestCase
{
public function testEmptyObject()
{
$plugin = new Plugin();
$this->assertNull($plugin->getName());
$this->assertNull($plugin->getPath());
$this->assertNull($plugin->getMetadata());
}
public function testGetterAndSetter()
{
$metadata = new PluginMetadata();
$metadata
->setDescription('foo')
->setHomepage('http://www.example.com')
->setVersion('13.7')
->setKimaiVersion('1.1')
;
$plugin = new Plugin();
$this->assertInstanceOf(Plugin::class, $plugin->setName('foo'));
$this->assertInstanceOf(Plugin::class, $plugin->setPath('bar'));
$this->assertInstanceOf(Plugin::class, $plugin->setMetadata($metadata));
$this->assertEquals('foo', $plugin->getName());
$this->assertEquals('bar', $plugin->getPath());
$this->assertSame($metadata, $plugin->getMetadata());
}
}