-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
IlluminateOutboxRepositoryTest.php
42 lines (35 loc) · 1.33 KB
/
IlluminateOutboxRepositoryTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
namespace EventSauce\MessageOutbox\IlluminateOutbox;
use EventSauce\EventSourcing\Serialization\ConstructingMessageSerializer;
use EventSauce\MessageOutbox\TestTooling\OutboxRepositoryTestCase;
use Illuminate\Database\Capsule\Manager;
use Illuminate\Database\ConnectionInterface;
class IlluminateOutboxRepositoryTest extends OutboxRepositoryTestCase
{
private ConnectionInterface $connection;
protected function setUp(): void
{
parent::setUp();
$manager = new Manager;
$manager->addConnection(
[
'driver' => 'mysql',
'host' => getenv('EVENTSAUCE_TESTING_MYSQL_HOST') ?: '127.0.0.1',
'port' => getenv('EVENTSAUCE_TESTING_MYSQL_PORT') ?: '3306',
'database' => 'outbox_messages',
'username' => 'username',
'password' => 'password',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
]
);
$this->connection = $manager->getConnection();
$this->connection->table('outbox_messages')->truncate();
}
protected function outboxMessageRepository(): IlluminateOutboxRepository
{
return new IlluminateOutboxRepository(
$this->connection, 'outbox_messages', new ConstructingMessageSerializer(),
);
}
}