From 8ddd56636154e5e55892fbb5ac9a5fe186b8df1f Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 7 May 2016 19:35:06 -0400 Subject: Improve plugin loading --- tests/units/Base.php | 6 ------ tests/units/Core/Plugin/LoaderTest.php | 23 ----------------------- tests/units/Core/Plugin/SchemaHandlerTest.php | 23 +++++++++++++++++++++++ 3 files changed, 23 insertions(+), 29 deletions(-) delete mode 100644 tests/units/Core/Plugin/LoaderTest.php create mode 100644 tests/units/Core/Plugin/SchemaHandlerTest.php (limited to 'tests') diff --git a/tests/units/Base.php b/tests/units/Base.php index a3dedafd..171f9b2b 100644 --- a/tests/units/Base.php +++ b/tests/units/Base.php @@ -8,7 +8,6 @@ use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher; use Symfony\Component\Stopwatch\Stopwatch; use SimpleLogger\Logger; -use SimpleLogger\File; use Kanboard\Core\Session\FlashMessage; use Kanboard\Core\Session\SessionStorage; use Kanboard\ServiceProvider\ActionProvider; @@ -91,9 +90,4 @@ abstract class Base extends PHPUnit_Framework_TestCase { $this->container['db']->closeConnection(); } - - public function isWindows() - { - return substr(PHP_OS, 0, 3) === 'WIN'; - } } diff --git a/tests/units/Core/Plugin/LoaderTest.php b/tests/units/Core/Plugin/LoaderTest.php deleted file mode 100644 index 448723d8..00000000 --- a/tests/units/Core/Plugin/LoaderTest.php +++ /dev/null @@ -1,23 +0,0 @@ -container); - $this->assertEquals(0, $p->getSchemaVersion('not_found')); - - $this->assertTrue($p->setSchemaVersion('plugin1', 1)); - $this->assertEquals(1, $p->getSchemaVersion('plugin1')); - - $this->assertTrue($p->setSchemaVersion('plugin2', 33)); - $this->assertEquals(33, $p->getSchemaVersion('plugin2')); - - $this->assertTrue($p->setSchemaVersion('plugin1', 2)); - $this->assertEquals(2, $p->getSchemaVersion('plugin1')); - } -} diff --git a/tests/units/Core/Plugin/SchemaHandlerTest.php b/tests/units/Core/Plugin/SchemaHandlerTest.php new file mode 100644 index 00000000..98a00e0b --- /dev/null +++ b/tests/units/Core/Plugin/SchemaHandlerTest.php @@ -0,0 +1,23 @@ +container); + $this->assertEquals(0, $p->getSchemaVersion('not_found')); + + $this->assertTrue($p->setSchemaVersion('plugin1', 1)); + $this->assertEquals(1, $p->getSchemaVersion('plugin1')); + + $this->assertTrue($p->setSchemaVersion('plugin2', 33)); + $this->assertEquals(33, $p->getSchemaVersion('plugin2')); + + $this->assertTrue($p->setSchemaVersion('plugin1', 2)); + $this->assertEquals(2, $p->getSchemaVersion('plugin1')); + } +} -- cgit v1.2.3