diff --git a/baseline.xml b/baseline.xml
index 4968da72d..189467027 100644
--- a/baseline.xml
+++ b/baseline.xml
@@ -149,14 +149,6 @@
-
-
-
-
-
-
-
-
]]>
@@ -191,10 +183,6 @@
-
-
-
-
@@ -209,17 +197,6 @@
-
-
-
-
-
-
-
-
- ]]>
-
-
diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon
index e1143c521..5bd0bb188 100644
--- a/phpstan-baseline.neon
+++ b/phpstan-baseline.neon
@@ -222,30 +222,6 @@ parameters:
count: 1
path: tests/Integration/BasicImplementation/BasicIntegrationTest.php
- -
- message: '#^Property Patchlevel\\EventSourcing\\Tests\\Integration\\BasicImplementation\\Profile\:\:\$id is never read, only written\.$#'
- identifier: property.onlyWritten
- count: 1
- path: tests/Integration/BasicImplementation/Profile.php
-
- -
- message: '#^Property Patchlevel\\EventSourcing\\Tests\\Integration\\BasicImplementation\\ProfileWithCommands\:\:\$id is never read, only written\.$#'
- identifier: property.onlyWritten
- count: 1
- path: tests/Integration/BasicImplementation/ProfileWithCommands.php
-
- -
- message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Patchlevel\\\\EventSourcing\\\\Tests\\\\Integration\\\\ChildAggregate\\\\Profile'' and Patchlevel\\EventSourcing\\Tests\\Integration\\ChildAggregate\\Profile will always evaluate to true\.$#'
- identifier: staticMethod.alreadyNarrowedType
- count: 2
- path: tests/Integration/ChildAggregate/ChildAggregateIntegrationTest.php
-
- -
- message: '#^Property Patchlevel\\EventSourcing\\Tests\\Integration\\ChildAggregate\\Profile\:\:\$id is never read, only written\.$#'
- identifier: property.onlyWritten
- count: 1
- path: tests/Integration/ChildAggregate/Profile.php
-
-
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Patchlevel\\\\EventSourcing\\\\Tests\\\\Integration\\\\MicroAggregate\\\\Profile'' and Patchlevel\\EventSourcing\\Tests\\Integration\\MicroAggregate\\Profile will always evaluate to true\.$#'
identifier: staticMethod.alreadyNarrowedType
@@ -426,12 +402,6 @@ parameters:
count: 1
path: tests/Unit/Fixture/ProfileWithSuppressAll.php
- -
- message: '#^Property Patchlevel\\EventSourcing\\Tests\\Unit\\Fixture\\WrongNormalizerBasicAggregate\:\:\$id is unused\.$#'
- identifier: property.unused
- count: 1
- path: tests/Unit/Fixture/WrongNormalizerBasicAggregate.php
-
-
message: '#^Parameter \#2 \$callable of class Patchlevel\\EventSourcing\\Message\\Translator\\ReplaceEventTranslator constructor expects callable\(Patchlevel\\EventSourcing\\Tests\\Unit\\Fixture\\MessagePublished\)\: object, Closure\(Patchlevel\\EventSourcing\\Tests\\Unit\\Fixture\\ProfileCreated\)\: Patchlevel\\EventSourcing\\Tests\\Unit\\Fixture\\ProfileVisited given\.$#'
identifier: argument.type
diff --git a/src/Subscription/Engine/DefaultSubscriptionEngine.php b/src/Subscription/Engine/DefaultSubscriptionEngine.php
index f269a9789..89b7caf65 100644
--- a/src/Subscription/Engine/DefaultSubscriptionEngine.php
+++ b/src/Subscription/Engine/DefaultSubscriptionEngine.php
@@ -16,8 +16,6 @@
use Patchlevel\EventSourcing\Subscription\Store\SubscriptionStore;
use Patchlevel\EventSourcing\Subscription\Subscriber\BatchableSubscriber;
use Patchlevel\EventSourcing\Subscription\Subscriber\MetadataSubscriberAccessor;
-use Patchlevel\EventSourcing\Subscription\Subscriber\RealSubscriberAccessor;
-use Patchlevel\EventSourcing\Subscription\Subscriber\SubscriberAccessor;
use Patchlevel\EventSourcing\Subscription\Subscriber\SubscriberAccessorRepository;
use Patchlevel\EventSourcing\Subscription\Subscription;
use Psr\Log\LoggerInterface;
@@ -875,7 +873,7 @@ private function handleMessage(int $index, Message $message, Subscription $subsc
return null;
}
- private function subscriber(string $subscriberId): SubscriberAccessor|null
+ private function subscriber(string $subscriberId): MetadataSubscriberAccessor|null
{
return $this->subscriberRepository->get($subscriberId);
}
@@ -959,18 +957,18 @@ private function discoverNewSubscriptions(): void
foreach ($this->subscriberRepository->all() as $subscriber) {
foreach ($subscriptions as $subscription) {
- if ($subscription->id() === $subscriber->id()) {
+ if ($subscription->id() === $subscriber->metadata()->id) {
continue 2;
}
}
$subscription = new Subscription(
- $subscriber->id(),
- $subscriber->group(),
- $subscriber->runMode(),
+ $subscriber->metadata()->id,
+ $subscriber->metadata()->group,
+ $subscriber->metadata()->runMode,
);
- if ($subscriber->setupMethod() === null && $subscriber->runMode() === RunMode::FromNow) {
+ if ($subscriber->setupMethod() === null && $subscriber->metadata()->runMode === RunMode::FromNow) {
if ($latestIndex === null) {
$latestIndex = $this->messageLoader->lastIndex();
}
@@ -984,7 +982,7 @@ private function discoverNewSubscriptions(): void
$this->logger?->info(
sprintf(
'Subscription Engine: New Subscriber "%s" was found and added to the subscription store.',
- $subscriber->id(),
+ $subscriber->metadata()->id,
),
);
}
@@ -1021,14 +1019,14 @@ private function handleFailed(Subscription $subscription, Throwable $throwable,
$subscriber = $this->subscriber($subscription->id());
- if (!$subscriber instanceof MetadataSubscriberAccessor) {
+ if (!$subscriber) {
$subscription->failed($throwable);
$this->subscriptionManager->update($subscription);
return;
}
- if ($subscriber->realSubscriber() instanceof BatchableSubscriber) {
+ if ($subscriber->subscriber() instanceof BatchableSubscriber) {
$subscription->failed($throwable);
$this->subscriptionManager->update($subscription);
@@ -1138,11 +1136,11 @@ private function checkAndBeginBatch(Subscription $subscription): Error|null
$subscriber = $this->subscriber($subscription->id());
- if (!$subscriber instanceof RealSubscriberAccessor) {
+ if (!$subscriber) {
return null;
}
- $realSubscriber = $subscriber->realSubscriber();
+ $realSubscriber = $subscriber->subscriber();
if (!$realSubscriber instanceof BatchableSubscriber) {
return null;
diff --git a/src/Subscription/Subscriber/ArgumentResolver/AggregateIdArgumentResolver.php b/src/Subscription/Subscriber/ArgumentResolver/AggregateIdArgumentResolver.php
deleted file mode 100644
index 97dd6844b..000000000
--- a/src/Subscription/Subscriber/ArgumentResolver/AggregateIdArgumentResolver.php
+++ /dev/null
@@ -1,31 +0,0 @@
- $class */
- $class = $argument->type;
- $id = $message->header(AggregateHeader::class)->aggregateId;
-
- return $class::fromString($id);
- }
-
- public function support(ArgumentMetadata $argument, string $eventClass): bool
- {
- return class_exists($argument->type) && is_a($argument->type, AggregateRootId::class, true);
- }
-}
diff --git a/src/Subscription/Subscriber/MetadataSubscriberAccessor.php b/src/Subscription/Subscriber/MetadataSubscriberAccessor.php
index a706adc7a..fadb165f0 100644
--- a/src/Subscription/Subscriber/MetadataSubscriberAccessor.php
+++ b/src/Subscription/Subscriber/MetadataSubscriberAccessor.php
@@ -9,7 +9,6 @@
use Patchlevel\EventSourcing\Message\Message;
use Patchlevel\EventSourcing\Metadata\Subscriber\SubscribeMethodMetadata;
use Patchlevel\EventSourcing\Metadata\Subscriber\SubscriberMetadata;
-use Patchlevel\EventSourcing\Subscription\RunMode;
use Patchlevel\EventSourcing\Subscription\Subscriber\ArgumentResolver\ArgumentResolver;
use Throwable;
@@ -18,7 +17,7 @@
use function array_map;
/** @template T of object */
-final class MetadataSubscriberAccessor implements SubscriberAccessor, RealSubscriberAccessor
+final class MetadataSubscriberAccessor
{
/** @var array> */
private array $subscribeCache = [];
@@ -45,24 +44,6 @@ public function subscriber(): object
return $this->subscriber;
}
- /** @deprecated use `->metadata()->id` instead */
- public function id(): string
- {
- return $this->metadata->id;
- }
-
- /** @deprecated use `->metadata()->group` instead */
- public function group(): string
- {
- return $this->metadata->group;
- }
-
- /** @deprecated use `->metadata()->runMode` instead */
- public function runMode(): RunMode
- {
- return $this->metadata->runMode;
- }
-
public function setupMethod(): Closure|null
{
$method = $this->metadata->setupMethod;
@@ -180,14 +161,4 @@ private function resolvers(string $eventClass, SubscribeMethodMetadata $method):
return $resolvers;
}
-
- /**
- * @deprecated use `->metadata()` instead
- *
- * @return T
- */
- public function realSubscriber(): object
- {
- return $this->subscriber;
- }
}
diff --git a/src/Subscription/Subscriber/MetadataSubscriberAccessorRepository.php b/src/Subscription/Subscriber/MetadataSubscriberAccessorRepository.php
index 9d66bbb46..88fe173f6 100644
--- a/src/Subscription/Subscriber/MetadataSubscriberAccessorRepository.php
+++ b/src/Subscription/Subscriber/MetadataSubscriberAccessorRepository.php
@@ -6,7 +6,6 @@
use Patchlevel\EventSourcing\Metadata\Subscriber\AttributeSubscriberMetadataFactory;
use Patchlevel\EventSourcing\Metadata\Subscriber\SubscriberMetadataFactory;
-use Patchlevel\EventSourcing\Subscription\Subscriber\ArgumentResolver\AggregateIdArgumentResolver;
use Patchlevel\EventSourcing\Subscription\Subscriber\ArgumentResolver\ArgumentResolver;
use Patchlevel\EventSourcing\Subscription\Subscriber\ArgumentResolver\EventArgumentResolver;
use Patchlevel\EventSourcing\Subscription\Subscriber\ArgumentResolver\MessageArgumentResolver;
@@ -41,7 +40,6 @@ public function __construct(
[
new MessageArgumentResolver(),
new EventArgumentResolver(),
- new AggregateIdArgumentResolver(),
new RecordedOnArgumentResolver(),
],
);
diff --git a/src/Subscription/Subscriber/RealSubscriberAccessor.php b/src/Subscription/Subscriber/RealSubscriberAccessor.php
deleted file mode 100644
index 072ea0045..000000000
--- a/src/Subscription/Subscriber/RealSubscriberAccessor.php
+++ /dev/null
@@ -1,11 +0,0 @@
-
- */
- public function subscribeMethods(string $eventClass): array;
-}
diff --git a/src/Subscription/Subscriber/SubscriberAccessorRepository.php b/src/Subscription/Subscriber/SubscriberAccessorRepository.php
index 0e299a239..be0f482d3 100644
--- a/src/Subscription/Subscriber/SubscriberAccessorRepository.php
+++ b/src/Subscription/Subscriber/SubscriberAccessorRepository.php
@@ -6,8 +6,8 @@
interface SubscriberAccessorRepository
{
- /** @return iterable */
+ /** @return iterable */
public function all(): iterable;
- public function get(string $id): SubscriberAccessor|null;
+ public function get(string $id): MetadataSubscriberAccessor|null;
}
diff --git a/tests/Benchmark/BasicImplementation/Events/NameChanged.php b/tests/Benchmark/BasicImplementation/Events/NameChanged.php
index 7a63430b7..2a1e54982 100644
--- a/tests/Benchmark/BasicImplementation/Events/NameChanged.php
+++ b/tests/Benchmark/BasicImplementation/Events/NameChanged.php
@@ -5,11 +5,13 @@
namespace Patchlevel\EventSourcing\Tests\Benchmark\BasicImplementation\Events;
use Patchlevel\EventSourcing\Attribute\Event;
+use Patchlevel\EventSourcing\Tests\Benchmark\BasicImplementation\ProfileId;
#[Event('profile.name_changed')]
final class NameChanged
{
public function __construct(
+ public ProfileId $profileId,
public string $name,
) {
}
diff --git a/tests/Benchmark/BasicImplementation/Profile.php b/tests/Benchmark/BasicImplementation/Profile.php
index 3a9cfd486..bbcf94bec 100644
--- a/tests/Benchmark/BasicImplementation/Profile.php
+++ b/tests/Benchmark/BasicImplementation/Profile.php
@@ -33,7 +33,7 @@ public static function create(ProfileId $id, string $name, string|null $email =
public function changeName(string $name): void
{
- $this->recordThat(new NameChanged($name));
+ $this->recordThat(new NameChanged($this->id, $name));
}
public function changeEmail(string $email): void
diff --git a/tests/Benchmark/BasicImplementation/Projection/BatchProfileProjector.php b/tests/Benchmark/BasicImplementation/Projection/BatchProfileProjector.php
index 1669225c1..8896906f2 100644
--- a/tests/Benchmark/BasicImplementation/Projection/BatchProfileProjector.php
+++ b/tests/Benchmark/BasicImplementation/Projection/BatchProfileProjector.php
@@ -13,7 +13,6 @@
use Patchlevel\EventSourcing\Subscription\Subscriber\SubscriberUtil;
use Patchlevel\EventSourcing\Tests\Benchmark\BasicImplementation\Events\NameChanged;
use Patchlevel\EventSourcing\Tests\Benchmark\BasicImplementation\Events\ProfileCreated;
-use Patchlevel\EventSourcing\Tests\Benchmark\BasicImplementation\ProfileId;
#[Projector('profile')]
final class BatchProfileProjector implements BatchableSubscriber
@@ -53,9 +52,9 @@ public function onProfileCreated(ProfileCreated $profileCreated): void
}
#[Subscribe(NameChanged::class)]
- public function onNameChanged(NameChanged $nameChanged, ProfileId $profileId): void
+ public function onNameChanged(NameChanged $nameChanged): void
{
- $this->nameChanged[$profileId->toString()] = $nameChanged->name;
+ $this->nameChanged[$nameChanged->profileId->toString()] = $nameChanged->name;
}
public function table(): string
diff --git a/tests/Benchmark/BasicImplementation/Projection/ProfileProjector.php b/tests/Benchmark/BasicImplementation/Projection/ProfileProjector.php
index ef100be3a..c80401ec8 100644
--- a/tests/Benchmark/BasicImplementation/Projection/ProfileProjector.php
+++ b/tests/Benchmark/BasicImplementation/Projection/ProfileProjector.php
@@ -12,7 +12,6 @@
use Patchlevel\EventSourcing\Subscription\Subscriber\SubscriberUtil;
use Patchlevel\EventSourcing\Tests\Benchmark\BasicImplementation\Events\NameChanged;
use Patchlevel\EventSourcing\Tests\Benchmark\BasicImplementation\Events\ProfileCreated;
-use Patchlevel\EventSourcing\Tests\Benchmark\BasicImplementation\ProfileId;
#[Projector('profile')]
final class ProfileProjector
@@ -49,12 +48,12 @@ public function onProfileCreated(ProfileCreated $profileCreated): void
}
#[Subscribe(NameChanged::class)]
- public function onNameChanged(NameChanged $nameChanged, ProfileId $profileId): void
+ public function onNameChanged(NameChanged $nameChanged): void
{
$this->connection->update(
$this->table(),
['name' => $nameChanged->name],
- ['id' => $profileId->toString()],
+ ['id' => $nameChanged->profileId->toString()],
);
}
diff --git a/tests/Integration/BasicImplementation/Events/NameChanged.php b/tests/Integration/BasicImplementation/Events/NameChanged.php
index 32bc6f223..132d78a3c 100644
--- a/tests/Integration/BasicImplementation/Events/NameChanged.php
+++ b/tests/Integration/BasicImplementation/Events/NameChanged.php
@@ -5,11 +5,13 @@
namespace Patchlevel\EventSourcing\Tests\Integration\BasicImplementation\Events;
use Patchlevel\EventSourcing\Attribute\Event;
+use Patchlevel\EventSourcing\Tests\Integration\BasicImplementation\ProfileId;
#[Event('profile.name_changed')]
final class NameChanged
{
public function __construct(
+ public ProfileId $profileId,
public string $name,
) {
}
diff --git a/tests/Integration/BasicImplementation/Profile.php b/tests/Integration/BasicImplementation/Profile.php
index ae28159a4..a4c5dde71 100644
--- a/tests/Integration/BasicImplementation/Profile.php
+++ b/tests/Integration/BasicImplementation/Profile.php
@@ -30,7 +30,7 @@ public static function create(ProfileId $id, string $name): self
public function changeName(string $name): void
{
- $this->recordThat(new NameChanged($name));
+ $this->recordThat(new NameChanged($this->id, $name));
}
#[Apply(ProfileCreated::class)]
diff --git a/tests/Integration/BasicImplementation/ProfileWithCommands.php b/tests/Integration/BasicImplementation/ProfileWithCommands.php
index bf05247b0..31a2d4e2a 100644
--- a/tests/Integration/BasicImplementation/ProfileWithCommands.php
+++ b/tests/Integration/BasicImplementation/ProfileWithCommands.php
@@ -45,7 +45,7 @@ public function changeName(
#[Inject('env')]
string $env,
): void {
- $this->recordThat(new NameChanged($command->name));
+ $this->recordThat(new NameChanged($this->id, $command->name));
}
#[Apply]
diff --git a/tests/Integration/BasicImplementation/Projection/ProfileProjector.php b/tests/Integration/BasicImplementation/Projection/ProfileProjector.php
index 1e33973fc..b62674fd6 100644
--- a/tests/Integration/BasicImplementation/Projection/ProfileProjector.php
+++ b/tests/Integration/BasicImplementation/Projection/ProfileProjector.php
@@ -12,7 +12,6 @@
use Patchlevel\EventSourcing\Attribute\Teardown;
use Patchlevel\EventSourcing\Tests\Integration\BasicImplementation\Events\NameChanged;
use Patchlevel\EventSourcing\Tests\Integration\BasicImplementation\Events\ProfileCreated;
-use Patchlevel\EventSourcing\Tests\Integration\BasicImplementation\ProfileId;
#[Projector('profile-1')]
final class ProfileProjector
@@ -52,12 +51,12 @@ public function handleProfileCreated(ProfileCreated $profileCreated): void
}
#[Subscribe(NameChanged::class)]
- public function handleNameChanged(NameChanged $nameChanged, ProfileId $profileId): void
+ public function handleNameChanged(NameChanged $nameChanged): void
{
$this->connection->executeStatement(
'UPDATE projection_profile SET name = :name WHERE id = :id;',
[
- 'id' => $profileId->toString(),
+ 'id' => $nameChanged->profileId->toString(),
'name' => $nameChanged->name,
],
);
diff --git a/tests/Integration/Subscription/Subscriber/ProfileProcessor.php b/tests/Integration/Subscription/Subscriber/ProfileProcessor.php
index 1a571de36..19d2bfd3c 100644
--- a/tests/Integration/Subscription/Subscriber/ProfileProcessor.php
+++ b/tests/Integration/Subscription/Subscriber/ProfileProcessor.php
@@ -10,7 +10,6 @@
use Patchlevel\EventSourcing\Tests\Integration\Subscription\Events\NameChanged;
use Patchlevel\EventSourcing\Tests\Integration\Subscription\Events\ProfileCreated;
use Patchlevel\EventSourcing\Tests\Integration\Subscription\Profile;
-use Patchlevel\EventSourcing\Tests\Integration\Subscription\ProfileId;
#[Processor('profile')]
final class ProfileProcessor
@@ -33,11 +32,11 @@ public function handleProfileCreated(ProfileCreated $profileCreated): void
}
#[Subscribe(NameChanged::class)]
- public function handleNameChanged(NameChanged $nameChanged, ProfileId $profileId): void
+ public function handleNameChanged(NameChanged $nameChanged): void
{
$repository = $this->repositoryManager->get(Profile::class);
- $profile = $repository->load($profileId);
+ $profile = $repository->load($nameChanged->profileId);
if ($profile->name() !== 'admin') {
return;
diff --git a/tests/Unit/Subscription/Subscriber/ArgumentResolver/AggregateIdArgumentResolverTest.php b/tests/Unit/Subscription/Subscriber/ArgumentResolver/AggregateIdArgumentResolverTest.php
deleted file mode 100644
index 4524e3a9a..000000000
--- a/tests/Unit/Subscription/Subscriber/ArgumentResolver/AggregateIdArgumentResolverTest.php
+++ /dev/null
@@ -1,66 +0,0 @@
-support(
- new ArgumentMetadata('aggregateId', Uuid::class),
- ProfileCreated::class,
- ),
- );
-
- self::assertTrue(
- $resolver->support(
- new ArgumentMetadata('aggregateRootId', ProfileId::class),
- ProfileCreated::class,
- ),
- );
-
- self::assertFalse(
- $resolver->support(
- new ArgumentMetadata('foo', ProfileCreated::class),
- ProfileCreated::class,
- ),
- );
- }
-
- public function testResolve(): void
- {
- $event = new ProfileVisited(ProfileId::fromString('1'));
-
- $resolver = new AggregateIdArgumentResolver();
- $message = (new Message($event))->withHeader(
- new AggregateHeader('foo', 'bar', 1, new DateTimeImmutable()),
- );
-
- self::assertEquals(
- new CustomId('bar'),
- $resolver->resolve(
- new ArgumentMetadata('foo', CustomId::class),
- $message,
- ),
- );
- }
-}
diff --git a/tests/Unit/Subscription/Subscriber/ArgumentResolver/LookupResolverTest.php b/tests/Unit/Subscription/Subscriber/ArgumentResolver/LookupResolverTest.php
index 6a46c45f4..e422c4219 100644
--- a/tests/Unit/Subscription/Subscriber/ArgumentResolver/LookupResolverTest.php
+++ b/tests/Unit/Subscription/Subscriber/ArgumentResolver/LookupResolverTest.php
@@ -12,7 +12,6 @@
use Patchlevel\EventSourcing\Store\Header\IndexHeader;
use Patchlevel\EventSourcing\Store\Store;
use Patchlevel\EventSourcing\Subscription\Lookup\Lookup;
-use Patchlevel\EventSourcing\Subscription\Subscriber\ArgumentResolver\AggregateIdArgumentResolver;
use Patchlevel\EventSourcing\Subscription\Subscriber\ArgumentResolver\LookupResolver;
use Patchlevel\EventSourcing\Tests\Unit\Fixture\ProfileCreated;
use Patchlevel\EventSourcing\Tests\Unit\Fixture\ProfileId;
@@ -20,7 +19,7 @@
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
-#[CoversClass(AggregateIdArgumentResolver::class)]
+#[CoversClass(LookupResolver::class)]
final class LookupResolverTest extends TestCase
{
public function testSupport(): void
diff --git a/tests/Unit/Subscription/Subscriber/MetadataSubscriberAccessorRepositoryTest.php b/tests/Unit/Subscription/Subscriber/MetadataSubscriberAccessorRepositoryTest.php
index fce3984d6..757a10362 100644
--- a/tests/Unit/Subscription/Subscriber/MetadataSubscriberAccessorRepositoryTest.php
+++ b/tests/Unit/Subscription/Subscriber/MetadataSubscriberAccessorRepositoryTest.php
@@ -62,7 +62,6 @@ public function support(ArgumentMetadata $argument, string $eventClass): bool
$customResolver,
new ArgumentResolver\MessageArgumentResolver(),
new ArgumentResolver\EventArgumentResolver(),
- new ArgumentResolver\AggregateIdArgumentResolver(),
new ArgumentResolver\RecordedOnArgumentResolver(),
],
);
diff --git a/tests/Unit/Subscription/Subscriber/MetadataSubscriberAccessorTest.php b/tests/Unit/Subscription/Subscriber/MetadataSubscriberAccessorTest.php
index 19f84f993..2e162417a 100644
--- a/tests/Unit/Subscription/Subscriber/MetadataSubscriberAccessorTest.php
+++ b/tests/Unit/Subscription/Subscriber/MetadataSubscriberAccessorTest.php
@@ -23,51 +23,6 @@
#[CoversClass(MetadataSubscriberAccessor::class)]
final class MetadataSubscriberAccessorTest extends TestCase
{
- public function testId(): void
- {
- $subscriber = new #[Subscriber('profile', RunMode::FromBeginning)]
- class {
- };
-
- $accessor = new MetadataSubscriberAccessor(
- $subscriber,
- (new AttributeSubscriberMetadataFactory())->metadata($subscriber::class),
- [],
- );
-
- self::assertEquals('profile', $accessor->id());
- }
-
- public function testGroup(): void
- {
- $subscriber = new #[Subscriber('profile', RunMode::FromBeginning)]
- class {
- };
-
- $accessor = new MetadataSubscriberAccessor(
- $subscriber,
- (new AttributeSubscriberMetadataFactory())->metadata($subscriber::class),
- [],
- );
-
- self::assertEquals('default', $accessor->group());
- }
-
- public function testRunMode(): void
- {
- $subscriber = new #[Subscriber('profile', RunMode::FromBeginning)]
- class {
- };
-
- $accessor = new MetadataSubscriberAccessor(
- $subscriber,
- (new AttributeSubscriberMetadataFactory())->metadata($subscriber::class),
- [],
- );
-
- self::assertEquals(RunMode::FromBeginning, $accessor->runMode());
- }
-
public function testSubscribeMethod(): void
{
$subscriber = new #[Subscriber('profile', RunMode::FromBeginning)]
@@ -274,6 +229,6 @@ class {
[],
);
- self::assertEquals($subscriber, $accessor->realSubscriber());
+ self::assertEquals($subscriber, $accessor->subscriber());
}
}