Skip to content

Commit 259a736

Browse files
committed
increase minimum version of PDOEventStore due prooph/pdo-event-store#257
1 parent 7ba7e2a commit 259a736

File tree

4 files changed

+22
-17
lines changed

4 files changed

+22
-17
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
"laminas/laminas-code": "^4",
125125
"jms/serializer": "^3.32",
126126
"laravel/framework": "^9.5.2|^10.0|^11.0|^12.0|^13.0",
127-
"prooph/pdo-event-store": "^1.16.2",
127+
"prooph/pdo-event-store": "^1.16.3",
128128
"psr/log": "^2.0|^3.0",
129129
"queue-interop/queue-interop": "^0.8",
130130
"ramsey/uuid": "^4.0",

packages/PdoEventSourcing/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
},
3535
"require": {
3636
"ecotone/dbal": "~1.254.0",
37-
"prooph/pdo-event-store": "^1.16.2"
37+
"prooph/pdo-event-store": "^1.16.3"
3838
},
3939
"require-dev": {
4040
"phpunit/phpunit": "^10.5|^11.0",
@@ -79,4 +79,4 @@
7979
"wikimedia/composer-merge-plugin": true
8080
}
8181
}
82-
}
82+
}

packages/PdoEventSourcing/tests/Integration/GapDetectionInPollingProjectionTest.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,35 +55,38 @@ protected function setUp(): void
5555
$this->missingEvent = $connection->fetchAssociative(sprintf('select * from %s where no = ?', $streamName), [2]);
5656
$connection->delete($streamName, ['no' => 2]);
5757

58-
$initialTimestamp = 1712501960;
58+
$initialTimestamp = (new \DateTimeImmutable('now', new \DateTimeZone('UTC')))->getTimestamp();
5959

6060
$metadata = json_decode($connection->fetchOne(sprintf('select metadata from %s where no = ?', $streamName), [1]), true);
6161
$metadata['timestamp'] = $initialTimestamp;
6262
$connection->update($streamName, ['metadata' => json_encode($metadata), 'created_at' => date(DATE_ATOM, $initialTimestamp)], ['no' => 1]);
6363

6464
$metadata = json_decode($connection->fetchOne(sprintf('select metadata from %s where no = ?', $streamName), [3]), true);
65-
$metadata['timestamp'] = $initialTimestamp + 100;
66-
$connection->update($streamName, ['metadata' => json_encode($metadata), 'created_at' => date(DATE_ATOM, $initialTimestamp + 100)], ['no' => 3]);
65+
$metadata['timestamp'] = $initialTimestamp + 10;
66+
$connection->update($streamName, ['metadata' => json_encode($metadata), 'created_at' => date(DATE_ATOM, $initialTimestamp + 10)], ['no' => 3]);
6767

6868
$metadata = json_decode($connection->fetchOne(sprintf('select metadata from %s where no = ?', $streamName), [4]), true);
69-
$metadata['timestamp'] = $initialTimestamp + 200;
70-
$connection->update($streamName, ['metadata' => json_encode($metadata), 'created_at' => date(DATE_ATOM, $initialTimestamp + 200)], ['no' => 4]);
69+
$metadata['timestamp'] = $initialTimestamp + 20;
70+
$connection->update($streamName, ['metadata' => json_encode($metadata), 'created_at' => date(DATE_ATOM, $initialTimestamp + 20)], ['no' => 4]);
7171
}
7272

7373
public function test_detecting_gaps_without_detection_window(): void
7474
{
75-
$gapDetection = new GapDetection([10, 20, 50]);
75+
$gapDetection = new GapDetection([0]);
7676

7777
$ecotone = $this->bootstrapEcotoneWithGapDetection($gapDetection);
7878
$ecotone->initializeProjection(InProgressTicketList::IN_PROGRESS_TICKET_PROJECTION);
7979
$ecotone->run(InProgressTicketList::IN_PROGRESS_TICKET_PROJECTION);
8080

8181
self::assertEquals([
8282
['ticket_id' => '123', 'ticket_type' => 'alert'],
83+
['ticket_id' => '124', 'ticket_type' => 'alert'],
84+
['ticket_id' => '125', 'ticket_type' => 'warning'],
8385
], $ecotone->sendQueryWithRouting('getInProgressTickets'));
8486

8587
$this->addMissingEvent();
8688

89+
$ecotone->resetProjection(InProgressTicketList::IN_PROGRESS_TICKET_PROJECTION);
8790
$ecotone->run(InProgressTicketList::IN_PROGRESS_TICKET_PROJECTION);
8891

8992
self::assertEquals([

packages/PdoEventSourcing/tests/Integration/GapDetectionInSynchronousProjectionTest.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Integration;
5+
namespace Test\Ecotone\EventSourcing\Integration;
66

77
use Doctrine\DBAL\Connection;
88
use Ecotone\Dbal\Configuration\DbalConfiguration;
@@ -54,35 +54,37 @@ protected function setUp(): void
5454
$this->missingEvent = $connection->fetchAssociative(sprintf('select * from %s where no = ?', $streamName), [2]);
5555
$connection->delete($streamName, ['no' => 2]);
5656

57-
$initialTimestamp = 1712501960;
57+
$initialTimestamp = time();
5858

5959
$metadata = json_decode($connection->fetchOne(sprintf('select metadata from %s where no = ?', $streamName), [1]), true);
6060
$metadata['timestamp'] = $initialTimestamp;
6161
$connection->update($streamName, ['metadata' => json_encode($metadata), 'created_at' => date(DATE_ATOM, $initialTimestamp)], ['no' => 1]);
6262

6363
$metadata = json_decode($connection->fetchOne(sprintf('select metadata from %s where no = ?', $streamName), [3]), true);
64-
$metadata['timestamp'] = $initialTimestamp + 100;
65-
$connection->update($streamName, ['metadata' => json_encode($metadata), 'created_at' => date(DATE_ATOM, $initialTimestamp + 100)], ['no' => 3]);
64+
$metadata['timestamp'] = $initialTimestamp + 10;
65+
$connection->update($streamName, ['metadata' => json_encode($metadata), 'created_at' => date(DATE_ATOM, $initialTimestamp + 10)], ['no' => 3]);
6666

6767
$metadata = json_decode($connection->fetchOne(sprintf('select metadata from %s where no = ?', $streamName), [4]), true);
68-
$metadata['timestamp'] = $initialTimestamp + 200;
69-
$connection->update($streamName, ['metadata' => json_encode($metadata), 'created_at' => date(DATE_ATOM, $initialTimestamp + 200)], ['no' => 4]);
68+
$metadata['timestamp'] = $initialTimestamp + 20;
69+
$connection->update($streamName, ['metadata' => json_encode($metadata), 'created_at' => date(DATE_ATOM, $initialTimestamp + 20)], ['no' => 4]);
7070
}
7171

7272
public function test_detecting_gaps_without_detection_window(): void
7373
{
74-
$ecotone = $this->bootstrapEcotoneWithGapDetection(new GapDetection([10, 20, 50], null));
74+
$ecotone = $this->bootstrapEcotoneWithGapDetection(new GapDetection([0], null));
7575
$ecotone->sendCommand(new CloseTicket('124'));
7676

7777
self::assertEquals(
7878
[
7979
['ticket_id' => '123', 'ticket_type' => 'alert'],
80+
['ticket_id' => '125', 'ticket_type' => 'warning'],
8081
],
8182
$ecotone->sendQueryWithRouting('getInProgressTickets')
8283
);
8384

8485
$this->addMissingEvent();
8586

87+
$ecotone->resetProjection(InProgressTicketList::IN_PROGRESS_TICKET_PROJECTION);
8688
$ecotone->triggerProjection(InProgressTicketList::IN_PROGRESS_TICKET_PROJECTION);
8789

8890
self::assertEquals(
@@ -95,7 +97,7 @@ public function test_detecting_gaps_without_detection_window(): void
9597

9698
public function test_detecting_gaps_with_detection_window(): void
9799
{
98-
$ecotone = $this->bootstrapEcotoneWithGapDetection(new GapDetection([10, 20, 50], new DateInterval('PT10S')));
100+
$ecotone = $this->bootstrapEcotoneWithGapDetection(new GapDetection([0], new DateInterval('PT1S')));
99101
$ecotone->sendCommand(new CloseTicket('124'));
100102

101103
self::assertEquals(

0 commit comments

Comments
 (0)