Skip to content
Permalink
Browse files

Add Nexy\Slack\Client service autowiring (#31)

  • Loading branch information
SeaquestNet authored and soullivaneuh committed Aug 12, 2019
1 parent 4e55be5 commit 18814a9c3b78f45d0633adb463b3d999592c564a
Showing with 10 additions and 5 deletions.
  1. +2 −0 CHANGELOG.md
  2. +3 −1 src/Resources/config/client.xml
  3. +5 −4 tests/DependencyInjection/NexySlackExtensionTest.php
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Add client service autowiring

## [2.1.0]
### Added
@@ -5,10 +5,12 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

<services>
<service id="nexy_slack.client" class="Nexy\Slack\Client" public="true">
<service id="Nexy\Slack\Client" public="true">
<argument>%nexy_slack.endpoint%</argument>
<argument>%nexy_slack.config%</argument>
<argument type="service" id="nexy_slack.http.client" />
</service>

<service id="nexy_slack.client" alias="Nexy\Slack\Client"/>
</services>
</container>
@@ -47,12 +47,13 @@ public function testLoadWithMinimalConfiguration(): void
$this->assertContainerBuilderHasParameter('nexy_slack.endpoint', $endpoint);
$this->assertContainerBuilderHasParameter('nexy_slack.config', $slackConfig);

$this->assertContainerBuilderHasService('nexy_slack.client', Client::class);
$this->assertContainerBuilderHasService(Client::class);

$this->assertContainerBuilderHasServiceDefinitionWithArgument('nexy_slack.client', 0, '%nexy_slack.endpoint%');
$this->assertContainerBuilderHasServiceDefinitionWithArgument('nexy_slack.client', 1, '%nexy_slack.config%');
$this->assertContainerBuilderHasServiceDefinitionWithArgument('nexy_slack.client', 2, new Reference('nexy_slack.http.client'));
$this->assertContainerBuilderHasServiceDefinitionWithArgument(Client::class, 0, '%nexy_slack.endpoint%');
$this->assertContainerBuilderHasServiceDefinitionWithArgument(Client::class, 1, '%nexy_slack.config%');
$this->assertContainerBuilderHasServiceDefinitionWithArgument(Client::class, 2, new Reference('nexy_slack.http.client'));

$this->assertContainerBuilderHasAlias('nexy_slack.client', Client::class);
$this->assertContainerBuilderHasAlias('nexy_slack.http.client', 'httplug.client');
}

0 comments on commit 18814a9

Please sign in to comment.
You can’t perform that action at this time.