Fixed test coverage
This commit is contained in:
parent
c74fa7955d
commit
9930668837
|
@ -93,6 +93,7 @@ class EngelsystemLoggerTest extends ApplicationFeatureTest
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @covers \Engelsystem\Logger\EngelsystemLogger::interpolate
|
||||||
* @covers \Engelsystem\Logger\EngelsystemLogger::log
|
* @covers \Engelsystem\Logger\EngelsystemLogger::log
|
||||||
* @dataProvider provideContextReplaceValues
|
* @dataProvider provideContextReplaceValues
|
||||||
*
|
*
|
||||||
|
@ -132,6 +133,7 @@ class EngelsystemLoggerTest extends ApplicationFeatureTest
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @covers \Engelsystem\Logger\EngelsystemLogger::checkLevel
|
||||||
* @covers \Engelsystem\Logger\EngelsystemLogger::log
|
* @covers \Engelsystem\Logger\EngelsystemLogger::log
|
||||||
*/
|
*/
|
||||||
public function testThrowExceptionOnInvalidLevel()
|
public function testThrowExceptionOnInvalidLevel()
|
||||||
|
|
|
@ -10,6 +10,8 @@ class ConfigServiceProviderTest extends ServiceProviderTest
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @covers \Engelsystem\Container\ServiceProvider::__construct
|
* @covers \Engelsystem\Container\ServiceProvider::__construct
|
||||||
|
* @covers \Engelsystem\Container\ServiceProvider::register
|
||||||
|
* @covers \Engelsystem\Container\ServiceProvider::boot
|
||||||
*/
|
*/
|
||||||
public function testRegister()
|
public function testRegister()
|
||||||
{
|
{
|
||||||
|
@ -18,5 +20,8 @@ class ConfigServiceProviderTest extends ServiceProviderTest
|
||||||
$serviceProvider = new ServiceProviderImplementation($app);
|
$serviceProvider = new ServiceProviderImplementation($app);
|
||||||
|
|
||||||
$this->assertInstanceOf(ServiceProvider::class, $serviceProvider);
|
$this->assertInstanceOf(ServiceProvider::class, $serviceProvider);
|
||||||
|
|
||||||
|
$serviceProvider->register();
|
||||||
|
$serviceProvider->boot();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,8 @@ class MigrateTest extends TestCase
|
||||||
$migration->expects($this->atLeastOnce())
|
$migration->expects($this->atLeastOnce())
|
||||||
->method('migrate')
|
->method('migrate')
|
||||||
->withConsecutive(
|
->withConsecutive(
|
||||||
|
['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/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/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/9876_03_22_210000_random_hack.php', '9876_03_22_210000_random_hack', Migrate::UP],
|
||||||
|
@ -62,12 +64,16 @@ class MigrateTest extends TestCase
|
||||||
$migration->expects($this->atLeastOnce())
|
$migration->expects($this->atLeastOnce())
|
||||||
->method('setMigrated')
|
->method('setMigrated')
|
||||||
->withConsecutive(
|
->withConsecutive(
|
||||||
|
['9876_03_22_210000_random_hack', Migrate::UP],
|
||||||
|
['9999_99_99_999999_another_foo', Migrate::UP],
|
||||||
['9876_03_22_210000_random_hack', Migrate::UP],
|
['9876_03_22_210000_random_hack', Migrate::UP],
|
||||||
['9999_99_99_999999_another_foo', Migrate::UP],
|
['9999_99_99_999999_another_foo', Migrate::UP],
|
||||||
['9876_03_22_210000_random_hack', Migrate::UP],
|
['9876_03_22_210000_random_hack', Migrate::UP],
|
||||||
['4567_11_01_000000_do_stuff', Migrate::DOWN]
|
['4567_11_01_000000_do_stuff', Migrate::DOWN]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$migration->run('foo', Migrate::UP);
|
||||||
|
|
||||||
$messages = [];
|
$messages = [];
|
||||||
$migration->setOutput(function ($text) use (&$messages) {
|
$migration->setOutput(function ($text) use (&$messages) {
|
||||||
$messages[] = $text;
|
$messages[] = $text;
|
||||||
|
|
|
@ -5,6 +5,7 @@ namespace Engelsystem\Test\Unit\Mail\Transport;
|
||||||
use Engelsystem\Test\Unit\Mail\Transport\Stub\TransportImplementation;
|
use Engelsystem\Test\Unit\Mail\Transport\Stub\TransportImplementation;
|
||||||
use PHPUnit\Framework\MockObject\MockObject;
|
use PHPUnit\Framework\MockObject\MockObject;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use Swift_Events_EventListener;
|
||||||
use Swift_Mime_SimpleMessage as SimpleMessage;
|
use Swift_Mime_SimpleMessage as SimpleMessage;
|
||||||
|
|
||||||
class TransportTest extends TestCase
|
class TransportTest extends TestCase
|
||||||
|
@ -12,13 +13,24 @@ class TransportTest extends TestCase
|
||||||
/**
|
/**
|
||||||
* @covers \Engelsystem\Mail\Transport\Transport::isStarted
|
* @covers \Engelsystem\Mail\Transport\Transport::isStarted
|
||||||
* @covers \Engelsystem\Mail\Transport\Transport::ping
|
* @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()
|
public function testMethods()
|
||||||
{
|
{
|
||||||
|
/** @var Swift_Events_EventListener|MockObject $plugin */
|
||||||
|
$plugin = $this->getMockForAbstractClass(Swift_Events_EventListener::class);
|
||||||
|
|
||||||
$transport = new TransportImplementation();
|
$transport = new TransportImplementation();
|
||||||
|
|
||||||
|
$transport->start();
|
||||||
|
$transport->registerPlugin($plugin);
|
||||||
|
|
||||||
$this->assertTrue($transport->isStarted());
|
$this->assertTrue($transport->isStarted());
|
||||||
$this->assertTrue($transport->ping());
|
$this->assertTrue($transport->ping());
|
||||||
|
|
||||||
|
$transport->stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue