Store sessions in database (#1736)
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Tests\Plugin\Fixtures;
|
||||
namespace App\Tests\Plugin\Fixtures\TestPlugin;
|
||||
|
||||
use App\Plugin\PluginInterface;
|
||||
|
||||
31
tests/Plugin/Fixtures/TestPlugin2/TestPlugin2.php
Normal file
31
tests/Plugin/Fixtures/TestPlugin2/TestPlugin2.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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\Fixtures\TestPlugin2;
|
||||
|
||||
use App\Plugin\PluginInterface;
|
||||
|
||||
class TestPlugin2 implements PluginInterface
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'TestPlugin';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getPath()
|
||||
{
|
||||
return __DIR__;
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,8 @@ use App\Plugin\Plugin;
|
||||
use App\Plugin\PluginInterface;
|
||||
use App\Plugin\PluginManager;
|
||||
use App\Plugin\PluginMetadata;
|
||||
use App\Tests\Plugin\Fixtures\TestPlugin;
|
||||
use App\Tests\Plugin\Fixtures\TestPlugin\TestPlugin;
|
||||
use App\Tests\Plugin\Fixtures\TestPlugin2\TestPlugin2;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
@@ -38,15 +39,13 @@ class PluginManagerTest extends TestCase
|
||||
{
|
||||
$sut = new PluginManager([]);
|
||||
|
||||
$plugin = $this->getMockBuilder(PluginInterface::class)
|
||||
->onlyMethods(['getName', 'getPath'])
|
||||
->getMock();
|
||||
|
||||
$plugin->method('getName')->willReturn('foo');
|
||||
$plugin->method('getPath')->willReturn('bar');
|
||||
$plugin = $this->createMock(PluginInterface::class);
|
||||
$plugin->expects($this->any())->method('getName')->willReturn('foo');
|
||||
$plugin->expects($this->any())->method('getPath')->willReturn('bar');
|
||||
|
||||
$sut->addPlugin(new TestPlugin());
|
||||
$sut->addPlugin($plugin);
|
||||
$sut->addPlugin(new TestPlugin2());
|
||||
$sut->addPlugin(new TestPlugin());
|
||||
|
||||
// make sure a plugin with the same name is not added twice, the first one wins!
|
||||
|
||||
Reference in New Issue
Block a user