Skip to content

Commit

Permalink
Minor test improvement.
Browse files Browse the repository at this point in the history
  • Loading branch information
Crell committed Mar 23, 2024
1 parent 09b5417 commit 8bba312
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/CompiledListenerProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ public function detects_invoke_method_and_gives_class_id_by_default(): void
$builder = new ProviderBuilder();
$container = new MockContainer();

$container->addService(InvokableListenerClassNoId::class, new InvokableListenerClassNoId());
$container->addService(InvokableListenerClassNoId::class, new InvokableListenerClassNoId('beep'));
$container->addService(InvokableListenerClassNoIdBefore::class, new InvokableListenerClassNoIdBefore());

$builder->listenerService(InvokableListenerClassNoId::class);
Expand Down
2 changes: 2 additions & 0 deletions tests/Listeners/InvokableListenerClassNoId.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#[ListenerPriority(priority: 5)]
class InvokableListenerClassNoId
{
public function __construct(public readonly string $val) {}

public function __invoke(CollectingEvent $event): void
{
$event->add(static::class);
Expand Down
2 changes: 1 addition & 1 deletion tests/OrderedListenerProviderServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public function detects_invoke_method_and_type_with_class_attribute(): void
public function detects_invoke_method_and_gives_class_id_by_default(): void
{
$container = new MockContainer();
$container->addService(InvokableListenerClassNoId::class, new InvokableListenerClassNoId());
$container->addService(InvokableListenerClassNoId::class, new InvokableListenerClassNoId('beep'));

$provider = new OrderedListenerProvider($container);

Expand Down

0 comments on commit 8bba312

Please sign in to comment.