Skip to content

Commit

Permalink
fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBadura committed Feb 4, 2024
1 parent 1f52d9f commit 5a9f10e
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 14 deletions.
3 changes: 2 additions & 1 deletion tests/Integration/BankAccountSplitStream/IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Patchlevel\EventSourcing\Metadata\AggregateRoot\AggregateRootRegistry;
use Patchlevel\EventSourcing\Metadata\AggregateRoot\AttributeAggregateRootRegistryFactory;
use Patchlevel\EventSourcing\Metadata\Event\AttributeEventMetadataFactory;
use Patchlevel\EventSourcing\Projection\Projection\ProjectionCriteria;
use Patchlevel\EventSourcing\Projection\Projection\Store\InMemoryStore;
use Patchlevel\EventSourcing\Projection\Projectionist\DefaultProjectionist;
use Patchlevel\EventSourcing\Projection\Projectionist\SyncProjectionistEventBusWrapper;
Expand Down Expand Up @@ -89,7 +90,7 @@ public function testSuccessful(): void
);

$schemaDirector->create();
$projectionist->boot();
$projectionist->boot(new ProjectionCriteria(), null, true);

$bankAccountId = AccountId::fromString('1');
$bankAccount = BankAccount::create($bankAccountId, 'John');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public function __construct(
public function create(): void
{
$table = new Table('projection_bank_account');
$table->addColumn('id', 'string');
$table->addColumn('name', 'string');
$table->addColumn('id', 'string')->setLength(36);
$table->addColumn('name', 'string')->setLength(255);
$table->addColumn('balance_in_cents', 'integer');
$table->setPrimaryKey(['id']);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Patchlevel\EventSourcing\EventBus\DefaultEventBus;
use Patchlevel\EventSourcing\Metadata\AggregateRoot\AggregateRootRegistry;
use Patchlevel\EventSourcing\Metadata\AggregateRoot\AttributeAggregateRootRegistryFactory;
use Patchlevel\EventSourcing\Projection\Projection\ProjectionCriteria;
use Patchlevel\EventSourcing\Projection\Projection\Store\InMemoryStore;
use Patchlevel\EventSourcing\Projection\Projectionist\DefaultProjectionist;
use Patchlevel\EventSourcing\Projection\Projectionist\SyncProjectionistEventBusWrapper;
Expand Down Expand Up @@ -88,7 +89,7 @@ public function testSuccessful(): void
);

$schemaDirector->create();
$projectionist->boot();
$projectionist->boot(new ProjectionCriteria(), null, true);

$profileId = ProfileId::fromString('1');
$profile = Profile::create($profileId, 'John');
Expand Down Expand Up @@ -161,7 +162,7 @@ public function testSnapshot(): void
);

$schemaDirector->create();
$projectionist->boot();
$projectionist->boot(new ProjectionCriteria(), null, true);

$profileId = ProfileId::fromString('1');
$profile = Profile::create($profileId, 'John');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public function __construct(
public function create(): void
{
$table = new Table('projection_profile');
$table->addColumn('id', 'string');
$table->addColumn('name', 'string');
$table->addColumn('id', 'string')->setLength(36);
$table->addColumn('name', 'string')->setLength(255);
$table->setPrimaryKey(['id']);

$this->connection->createSchemaManager()->createTable($table);
Expand Down
3 changes: 2 additions & 1 deletion tests/Integration/Outbox/OutboxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Patchlevel\EventSourcing\Outbox\EventBusPublisher;
use Patchlevel\EventSourcing\Outbox\OutboxEventBus;
use Patchlevel\EventSourcing\Outbox\StoreOutboxConsumer;
use Patchlevel\EventSourcing\Projection\Projection\ProjectionCriteria;
use Patchlevel\EventSourcing\Projection\Projection\Store\InMemoryStore;
use Patchlevel\EventSourcing\Projection\Projectionist\DefaultProjectionist;
use Patchlevel\EventSourcing\Projection\Projectionist\SyncProjectionistEventBusWrapper;
Expand Down Expand Up @@ -100,7 +101,7 @@ public function testSuccessful(): void
);

$schemaDirector->create();
$projectionist->boot();
$projectionist->boot(new ProjectionCriteria(), null, true);

$profile = Profile::create(ProfileId::fromString('1'), 'John');
$repository->save($profile);
Expand Down
4 changes: 2 additions & 2 deletions tests/Integration/Outbox/Projection/ProfileProjector.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public function __construct(
public function create(): void
{
$table = new Table('projection_profile');
$table->addColumn('id', 'string');
$table->addColumn('name', 'string');
$table->addColumn('id', 'string')->setLength(36);
$table->addColumn('name', 'string')->setLength(255);
$table->setPrimaryKey(['id']);

$this->connection->createSchemaManager()->createTable($table);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public function __construct(
public function create(): void
{
$table = new Table($this->tableName());
$table->addColumn('id', 'string');
$table->addColumn('name', 'string');
$table->addColumn('id', 'string')->setLength(36);
$table->addColumn('name', 'string')->setLength(255);
$table->setPrimaryKey(['id']);

$this->connection->createSchemaManager()->createTable($table);
Expand Down
5 changes: 3 additions & 2 deletions tests/Integration/Projectionist/ProjectionistTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Patchlevel\EventSourcing\Lock\DoctrineDbalStoreSchemaAdapter;
use Patchlevel\EventSourcing\Metadata\AggregateRoot\AggregateRootRegistry;
use Patchlevel\EventSourcing\Metadata\AggregateRoot\AttributeAggregateRootRegistryFactory;
use Patchlevel\EventSourcing\Projection\Projection\ProjectionCriteria;
use Patchlevel\EventSourcing\Projection\Projection\Store\DoctrineStore;
use Patchlevel\EventSourcing\Projection\Projectionist\DefaultProjectionist;
use Patchlevel\EventSourcing\Projection\Projectionist\SyncProjectionistEventBusWrapper;
Expand Down Expand Up @@ -138,12 +139,12 @@ public function testSync(): void

$schemaDirector->drop();
$schemaDirector->create();
$projectionist->boot();
$projectionist->boot(new ProjectionCriteria(), null, true);

$profile = Profile::create(ProfileId::fromString('1'), 'John');
$repository->save($profile);

$projectionist->run();
$projectionist->run(new ProjectionCriteria(), null, true);

$result = $this->connection->fetchAssociative('SELECT * FROM projection_profile_1 WHERE id = ?', ['1']);

Expand Down

0 comments on commit 5a9f10e

Please sign in to comment.