-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
when EventSourcedAggregate factory method does not return events, Sav…
…eAggregateService should not try to save it (#151) * dropping behat tests in DBAL Module by rewriting them with Ecotone Test Support * dropping behat tests in AMQP Module by rewriting them with Ecotone Test Support * dropping behat in Module Template * when EventSourcedAggregate factory method does not return events, SaveAggregateService should not try to save it in addition - removing AggregateFactory attrobute due its deprecation
- Loading branch information
1 parent
a3a52b9
commit b552479
Showing
8 changed files
with
105 additions
and
41 deletions.
There are no files selected for viewing
10 changes: 0 additions & 10 deletions
10
packages/Ecotone/src/Modelling/Attribute/AggregateFactory.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
packages/Ecotone/tests/Modelling/Fixture/NoEventsReturnedFromFactoryMethod/Aggregate.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Test\Ecotone\Modelling\Fixture\NoEventsReturnedFromFactoryMethod; | ||
|
||
use Ecotone\Modelling\Attribute\AggregateIdentifier; | ||
use Ecotone\Modelling\Attribute\CommandHandler; | ||
use Ecotone\Modelling\Attribute\EventSourcingAggregate; | ||
use Ecotone\Modelling\Attribute\EventSourcingHandler; | ||
use Ecotone\Modelling\WithAggregateVersioning; | ||
|
||
#[EventSourcingAggregate] | ||
final class Aggregate | ||
{ | ||
use WithAggregateVersioning; | ||
|
||
#[AggregateIdentifier] | ||
private int $id; | ||
|
||
#[CommandHandler(routingKey: 'aggregate.create')] | ||
public static function create(): array | ||
{ | ||
return []; | ||
} | ||
|
||
#[EventSourcingHandler] | ||
public function when(AggregateCreated $event): void | ||
{ | ||
$this->id = $event->id; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...es/Ecotone/tests/Modelling/Fixture/NoEventsReturnedFromFactoryMethod/AggregateCreated.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Test\Ecotone\Modelling\Fixture\NoEventsReturnedFromFactoryMethod; | ||
|
||
final class AggregateCreated | ||
{ | ||
public function __construct(public int $id) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters