summaryrefslogtreecommitdiff
path: root/tests/Unit
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2019-04-24 12:58:13 +0200
committermsquare <msquare@notrademark.de>2019-04-25 17:56:06 +0200
commit99306688370874b3153ec6ab185a58044881cb1a (patch)
treed0091ccdec3bf71024c376b4b2bfc4db4440f0d4 /tests/Unit
parentc74fa7955d9392aea954c2e45ed4137fb2bebcbe (diff)
Fixed test coverage
Diffstat (limited to 'tests/Unit')
-rw-r--r--tests/Unit/Container/ServiceProviderTest.php5
-rw-r--r--tests/Unit/Database/Migration/MigrateTest.php6
-rw-r--r--tests/Unit/Mail/Transport/TransportTest.php12
3 files changed, 23 insertions, 0 deletions
diff --git a/tests/Unit/Container/ServiceProviderTest.php b/tests/Unit/Container/ServiceProviderTest.php
index 8a9cb76e..b817e3bb 100644
--- a/tests/Unit/Container/ServiceProviderTest.php
+++ b/tests/Unit/Container/ServiceProviderTest.php
@@ -10,6 +10,8 @@ class ConfigServiceProviderTest extends ServiceProviderTest
{
/**
* @covers \Engelsystem\Container\ServiceProvider::__construct
+ * @covers \Engelsystem\Container\ServiceProvider::register
+ * @covers \Engelsystem\Container\ServiceProvider::boot
*/
public function testRegister()
{
@@ -18,5 +20,8 @@ class ConfigServiceProviderTest extends ServiceProviderTest
$serviceProvider = new ServiceProviderImplementation($app);
$this->assertInstanceOf(ServiceProvider::class, $serviceProvider);
+
+ $serviceProvider->register();
+ $serviceProvider->boot();
}
}
diff --git a/tests/Unit/Database/Migration/MigrateTest.php b/tests/Unit/Database/Migration/MigrateTest.php
index 3a9adbe8..6dffbe2f 100644
--- a/tests/Unit/Database/Migration/MigrateTest.php
+++ b/tests/Unit/Database/Migration/MigrateTest.php
@@ -57,6 +57,8 @@ class MigrateTest extends TestCase
['foo/9876_03_22_210000_random_hack.php', '9876_03_22_210000_random_hack', Migrate::UP],
['foo/9999_99_99_999999_another_foo.php', '9999_99_99_999999_another_foo', Migrate::UP],
['foo/9876_03_22_210000_random_hack.php', '9876_03_22_210000_random_hack', Migrate::UP],
+ ['foo/9999_99_99_999999_another_foo.php', '9999_99_99_999999_another_foo', Migrate::UP],
+ ['foo/9876_03_22_210000_random_hack.php', '9876_03_22_210000_random_hack', Migrate::UP],
['foo/4567_11_01_000000_do_stuff.php', '4567_11_01_000000_do_stuff', Migrate::DOWN]
);
$migration->expects($this->atLeastOnce())
@@ -65,9 +67,13 @@ class MigrateTest extends TestCase
['9876_03_22_210000_random_hack', Migrate::UP],
['9999_99_99_999999_another_foo', Migrate::UP],
['9876_03_22_210000_random_hack', Migrate::UP],
+ ['9999_99_99_999999_another_foo', Migrate::UP],
+ ['9876_03_22_210000_random_hack', Migrate::UP],
['4567_11_01_000000_do_stuff', Migrate::DOWN]
);
+ $migration->run('foo', Migrate::UP);
+
$messages = [];
$migration->setOutput(function ($text) use (&$messages) {
$messages[] = $text;
diff --git a/tests/Unit/Mail/Transport/TransportTest.php b/tests/Unit/Mail/Transport/TransportTest.php
index 60f2079d..5e7b7b9b 100644
--- a/tests/Unit/Mail/Transport/TransportTest.php
+++ b/tests/Unit/Mail/Transport/TransportTest.php
@@ -5,6 +5,7 @@ namespace Engelsystem\Test\Unit\Mail\Transport;
use Engelsystem\Test\Unit\Mail\Transport\Stub\TransportImplementation;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
+use Swift_Events_EventListener;
use Swift_Mime_SimpleMessage as SimpleMessage;
class TransportTest extends TestCase
@@ -12,13 +13,24 @@ class TransportTest extends TestCase
/**
* @covers \Engelsystem\Mail\Transport\Transport::isStarted
* @covers \Engelsystem\Mail\Transport\Transport::ping
+ * @covers \Engelsystem\Mail\Transport\Transport::registerPlugin
+ * @covers \Engelsystem\Mail\Transport\Transport::start
+ * @covers \Engelsystem\Mail\Transport\Transport::stop
*/
public function testMethods()
{
+ /** @var Swift_Events_EventListener|MockObject $plugin */
+ $plugin = $this->getMockForAbstractClass(Swift_Events_EventListener::class);
+
$transport = new TransportImplementation();
+ $transport->start();
+ $transport->registerPlugin($plugin);
+
$this->assertTrue($transport->isStarted());
$this->assertTrue($transport->ping());
+
+ $transport->stop();
}
/**