Skip to content

Commit

Permalink
correct configure browser service
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-gribanov committed Jul 27, 2017
1 parent 990b07c commit b91e043
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
Expand Up @@ -29,10 +29,10 @@ public function load(array $configs, ContainerBuilder $container)
$config = $this->processConfiguration(new Configuration(), $configs);

$container->getDefinition('anime_db.anime_news_network.browser')
->replaceArgument(1, $config['host'])
->replaceArgument(2, $config['reports'])
->replaceArgument(3, $config['details'])
->replaceArgument(4, $config['client'])
->replaceArgument(2, $config['host'])
->replaceArgument(3, $config['reports'])
->replaceArgument(4, $config['details'])
->replaceArgument(5, $config['client'])
;
}
}
12 changes: 11 additions & 1 deletion src/Resources/config/services.yml
@@ -1,7 +1,17 @@
services:
anime_db.anime_news_network.browser:
class: AnimeDb\Bundle\AnimeNewsNetworkBrowserBundle\Service\Browser
arguments: [ '@anime_db.anime_news_network.browser.client', ~, ~, ~, ~ ]
arguments:
- '@anime_db.anime_news_network.browser.client'
- '@anime_db.anime_news_network.browser.error_detector'
- ~
- ~
- ~
- ~

anime_db.anime_news_network.browser.error_detector:
class: AnimeDb\Bundle\AnimeNewsNetworkBrowserBundle\Service\ErrorDetector
public: false

anime_db.anime_news_network.browser.client:
class: GuzzleHttp\Client
Expand Down
Expand Up @@ -77,25 +77,25 @@ public function testLoad(array $config, $host, $reports, $details, $client)
$browser
->expects($this->at(0))
->method('replaceArgument')
->with(1, $host)
->with(2, $host)
->will($this->returnSelf())
;
$browser
->expects($this->at(1))
->method('replaceArgument')
->with(2, $reports)
->with(3, $reports)
->will($this->returnSelf())
;
$browser
->expects($this->at(2))
->method('replaceArgument')
->with(3, $details)
->with(4, $details)
->will($this->returnSelf())
;
$browser
->expects($this->at(3))
->method('replaceArgument')
->with(4, $client)
->with(5, $client)
->will($this->returnSelf())
;

Expand Down

0 comments on commit b91e043

Please sign in to comment.