2017-10-31 13:40:13 +01:00
|
|
|
<?php
|
|
|
|
|
2023-02-03 20:41:59 +01:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2017-10-31 14:23:23 +01:00
|
|
|
namespace Engelsystem\Test\Feature\Database;
|
2017-10-31 13:40:13 +01:00
|
|
|
|
|
|
|
use Engelsystem\Config\Config;
|
2019-10-13 21:06:24 +02:00
|
|
|
use Engelsystem\Database\Database;
|
2017-10-31 13:40:13 +01:00
|
|
|
use Engelsystem\Database\DatabaseServiceProvider;
|
|
|
|
|
2017-10-31 19:26:48 +01:00
|
|
|
class DatabaseServiceProviderTest extends DatabaseTest
|
2017-10-31 13:40:13 +01:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @covers \Engelsystem\Database\DatabaseServiceProvider::register()
|
|
|
|
*/
|
2022-12-14 19:15:20 +01:00
|
|
|
public function testRegister(): void
|
2017-10-31 13:40:13 +01:00
|
|
|
{
|
2019-10-13 21:06:24 +02:00
|
|
|
$this->app->instance('config', new Config([
|
|
|
|
'database' => $this->getDbConfig(),
|
|
|
|
'timezone' => 'UTC',
|
|
|
|
]));
|
2017-10-31 13:40:13 +01:00
|
|
|
|
2019-10-13 21:06:24 +02:00
|
|
|
$serviceProvider = new DatabaseServiceProvider($this->app);
|
2017-10-31 13:40:13 +01:00
|
|
|
$serviceProvider->register();
|
2019-10-13 21:06:24 +02:00
|
|
|
$this->assertTrue($this->app->has(Database::class));
|
2017-10-31 13:40:13 +01:00
|
|
|
}
|
|
|
|
}
|