Skip to content

Commit

Permalink
Add name to service in handler stack
Browse files Browse the repository at this point in the history
  • Loading branch information
gregurco committed Nov 3, 2017
1 parent 3bdcc17 commit 318fb2e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/GuzzleBundleCachePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function loadForClient(array $config, ContainerBuilder $container, string

$cacheMiddlewareExpression = new Expression(sprintf('service("%s")', $cacheMiddlewareDefinitionName));

$handler->addMethodCall('push', [$cacheMiddlewareExpression]);
$handler->addMethodCall('push', [$cacheMiddlewareExpression, 'cache']);
}
}

Expand Down
2 changes: 2 additions & 0 deletions tests/GuzzleBundleCachePluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ public function testLoadForClientWithNoStrategy()

$this->assertTrue($container->hasDefinition('guzzle_bundle_cache_plugin.middleware.api_payment'));
$this->assertCount(1, $handler->getMethodCalls());
$this->assertTrue(isset($handler->getMethodCalls()[0][1][1]), 'No name provided for middleware');
$this->assertEquals('cache', $handler->getMethodCalls()[0][1][1]);

$clientMiddlewareDefinition = $container->getDefinition('guzzle_bundle_cache_plugin.middleware.api_payment');
$this->assertCount(0, $clientMiddlewareDefinition->getArguments());
Expand Down

0 comments on commit 318fb2e

Please sign in to comment.