-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
15 additions
and
13 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase; | ||
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; | ||
use Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument; | ||
use Symfony\Component\DependencyInjection\Reference; | ||
use Zenstruck\ScheduleBundle\Command\ScheduleListCommand; | ||
use Zenstruck\ScheduleBundle\Command\ScheduleRunCommand; | ||
use Zenstruck\ScheduleBundle\DependencyInjection\ZenstruckScheduleExtension; | ||
|
@@ -134,7 +135,7 @@ public function can_configure_single_server_lock_factory() | |
{ | ||
$this->load(['single_server_lock_factory' => 'my_factory']); | ||
|
||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(SingleServerHandler::class, 0, 'my_factory'); | ||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(SingleServerHandler::class, 0, new Reference('my_factory')); | ||
$this->assertContainerBuilderHasServiceDefinitionWithTag(SingleServerHandler::class, 'schedule.extension_handler'); | ||
} | ||
|
||
|
@@ -145,7 +146,7 @@ public function can_configure_without_overlapping_handler_lock_factory() | |
{ | ||
$this->load(['without_overlapping_lock_factory' => 'my_factory']); | ||
|
||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(WithoutOverlappingHandler::class, 0, 'my_factory'); | ||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(WithoutOverlappingHandler::class, 0, new Reference('my_factory')); | ||
$this->assertContainerBuilderHasServiceDefinitionWithTag(WithoutOverlappingHandler::class, 'schedule.extension_handler'); | ||
} | ||
|
||
|
@@ -156,9 +157,9 @@ public function can_configure_http_client() | |
{ | ||
$this->load(['http_client' => 'my_client']); | ||
|
||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(PingHandler::class, 0, 'my_client'); | ||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(PingHandler::class, 0, new Reference('my_client')); | ||
$this->assertContainerBuilderHasServiceDefinitionWithTag(PingHandler::class, 'schedule.extension_handler'); | ||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(PingTaskRunner::class, 0, 'my_client'); | ||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(PingTaskRunner::class, 0, new Reference('my_client')); | ||
$this->assertContainerBuilderHasServiceDefinitionWithTag(PingTaskRunner::class, 'schedule.task_runner'); | ||
} | ||
|
||
|
@@ -169,7 +170,7 @@ public function can_enable_messenger_with_default_bus(): void | |
{ | ||
$this->load(['messenger' => null]); | ||
|
||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(MessageTaskRunner::class, 0, 'message_bus'); | ||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(MessageTaskRunner::class, 0, new Reference('message_bus')); | ||
$this->assertContainerBuilderHasServiceDefinitionWithTag(MessageTaskRunner::class, 'schedule.task_runner'); | ||
} | ||
|
||
|
@@ -180,7 +181,7 @@ public function can_enable_messenger_with_custom_bus(): void | |
{ | ||
$this->load(['messenger' => ['message_bus' => 'my_bus']]); | ||
|
||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(MessageTaskRunner::class, 0, 'my_bus'); | ||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(MessageTaskRunner::class, 0, new Reference('my_bus')); | ||
$this->assertContainerBuilderHasServiceDefinitionWithTag(MessageTaskRunner::class, 'schedule.task_runner'); | ||
} | ||
|
||
|
@@ -196,7 +197,7 @@ public function can_configure_email_handler() | |
'subject_prefix' => '[Acme Inc]', | ||
]]); | ||
|
||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(EmailHandler::class, 0, 'my_mailer'); | ||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(EmailHandler::class, 0, new Reference('my_mailer')); | ||
$this->assertContainerBuilderHasServiceDefinitionWithTag(EmailHandler::class, 'schedule.extension_handler'); | ||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(EmailHandler::class, 1, '[email protected]'); | ||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(EmailHandler::class, 2, '[email protected]'); | ||
|
@@ -216,7 +217,7 @@ public function can_configure_notifier_handler() | |
'subject_prefix' => '[Acme Inc]', | ||
]]); | ||
|
||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(NotifierHandler::class, 0, 'my_notifier'); | ||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(NotifierHandler::class, 0, new Reference('my_notifier')); | ||
$this->assertContainerBuilderHasServiceDefinitionWithTag(NotifierHandler::class, 'schedule.extension_handler'); | ||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(NotifierHandler::class, 1, ['chat/slack']); | ||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(NotifierHandler::class, 2, '[email protected]'); | ||
|
@@ -237,7 +238,7 @@ public function can_configure_notifier_handler_with_array_channel() | |
'subject_prefix' => '[Acme Inc]', | ||
]]); | ||
|
||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(NotifierHandler::class, 0, 'my_notifier'); | ||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(NotifierHandler::class, 0, new Reference('my_notifier')); | ||
$this->assertContainerBuilderHasServiceDefinitionWithTag(NotifierHandler::class, 'schedule.extension_handler'); | ||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(NotifierHandler::class, 1, ['chat/slack', 'teams']); | ||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(NotifierHandler::class, 2, '[email protected]'); | ||
|
@@ -254,7 +255,7 @@ public function minimum_email_handler_configuration() | |
'service' => 'my_mailer', | ||
]]); | ||
|
||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(EmailHandler::class, 0, 'my_mailer'); | ||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(EmailHandler::class, 0, new Reference('my_mailer')); | ||
$this->assertContainerBuilderHasServiceDefinitionWithTag(EmailHandler::class, 'schedule.extension_handler'); | ||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(EmailHandler::class, 1, null); | ||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(EmailHandler::class, 2, null); | ||
|
@@ -270,7 +271,7 @@ public function minimum_notifier_handler_configuration() | |
'service' => 'my_notifier', | ||
]]); | ||
|
||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(NotifierHandler::class, 0, 'my_notifier'); | ||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(NotifierHandler::class, 0, new Reference('my_notifier')); | ||
$this->assertContainerBuilderHasServiceDefinitionWithTag(NotifierHandler::class, 'schedule.extension_handler'); | ||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(NotifierHandler::class, 1, []); | ||
$this->assertContainerBuilderHasServiceDefinitionWithArgument(NotifierHandler::class, 2, null); | ||
|
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