Skip to content

Commit 201b11e

Browse files
committed
removed stopwatch
1 parent 6d14164 commit 201b11e

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

DependencyInjection/HttplugExtension.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,6 @@ private function configureClient(ContainerBuilder $container, $clientName, array
279279

280280
$pluginClientOptions = [];
281281
if ($profiling) {
282-
// Add the stopwatch plugin
283-
if (!in_array('httplug.plugin.stopwatch', $arguments['plugins'])) {
284-
array_unshift($plugins, 'httplug.plugin.stopwatch');
285-
}
286-
287282
//Decorate each plugin with a ProfilePlugin instance.
288283
foreach ($plugins as $pluginServiceId) {
289284
$this->decoratePluginWithProfilePlugin($container, $pluginServiceId);

Tests/Unit/Collector/ProfileClientFactoryTest.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Http\HttplugBundle\Collector\Formatter;
99
use Http\HttplugBundle\Collector\ProfileClient;
1010
use Http\HttplugBundle\Collector\ProfileClientFactory;
11+
use Symfony\Component\Stopwatch\Stopwatch;
1112

1213
class ProfileClientFactoryTest extends \PHPUnit_Framework_TestCase
1314
{
@@ -21,6 +22,11 @@ class ProfileClientFactoryTest extends \PHPUnit_Framework_TestCase
2122
*/
2223
private $formatter;
2324

25+
/**
26+
* @var Stopwatch
27+
*/
28+
private $stopwatch;
29+
2430
/**
2531
* @var HttpClient
2632
*/
@@ -30,6 +36,7 @@ public function setUp()
3036
{
3137
$this->collector = $this->getMockBuilder(Collector::class)->disableOriginalConstructor()->getMock();
3238
$this->formatter = $this->getMockBuilder(Formatter::class)->disableOriginalConstructor()->getMock();
39+
$this->stopwatch = $this->getMockBuilder(Stopwatch::class)->getMock();
3340
$this->client = $this->getMockBuilder(HttpClient::class)->getMock();
3441
}
3542

@@ -38,7 +45,7 @@ public function testCreateClientFromClientFactory()
3845
$factory = $this->getMockBuilder(ClientFactory::class)->getMock();
3946
$factory->method('createClient')->willReturn($this->client);
4047

41-
$subject = new ProfileClientFactory($factory, $this->collector, $this->formatter);
48+
$subject = new ProfileClientFactory($factory, $this->collector, $this->formatter, $this->stopwatch);
4249

4350
$this->assertInstanceOf(ProfileClient::class, $subject->createClient());
4451
}
@@ -49,7 +56,7 @@ public function testCreateClientFromCallable()
4956
return $this->client;
5057
};
5158

52-
$subject = new ProfileClientFactory($factory, $this->collector, $this->formatter);
59+
$subject = new ProfileClientFactory($factory, $this->collector, $this->formatter, $this->stopwatch);
5360

5461
$this->assertInstanceOf(ProfileClient::class, $subject->createClient());
5562
}

Tests/Unit/DependencyInjection/HttplugExtensionTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ public function testClientPlugins()
117117

118118
$plugins = [
119119
'httplug.client.acme.plugin.stack',
120-
'httplug.plugin.stopwatch',
121120
'httplug.client.acme.plugin.decoder',
122121
'httplug.plugin.redirect',
123122
'httplug.client.acme.plugin.add_host',

0 commit comments

Comments
 (0)