8
8
use Http \HttplugBundle \Collector \Formatter ;
9
9
use Http \HttplugBundle \Collector \ProfileClient ;
10
10
use Http \HttplugBundle \Collector \ProfileClientFactory ;
11
+ use Symfony \Component \Stopwatch \Stopwatch ;
11
12
12
13
class ProfileClientFactoryTest extends \PHPUnit_Framework_TestCase
13
14
{
@@ -21,6 +22,11 @@ class ProfileClientFactoryTest extends \PHPUnit_Framework_TestCase
21
22
*/
22
23
private $ formatter ;
23
24
25
+ /**
26
+ * @var Stopwatch
27
+ */
28
+ private $ stopwatch ;
29
+
24
30
/**
25
31
* @var HttpClient
26
32
*/
@@ -30,6 +36,7 @@ public function setUp()
30
36
{
31
37
$ this ->collector = $ this ->getMockBuilder (Collector::class)->disableOriginalConstructor ()->getMock ();
32
38
$ this ->formatter = $ this ->getMockBuilder (Formatter::class)->disableOriginalConstructor ()->getMock ();
39
+ $ this ->stopwatch = $ this ->getMockBuilder (Stopwatch::class)->getMock ();
33
40
$ this ->client = $ this ->getMockBuilder (HttpClient::class)->getMock ();
34
41
}
35
42
@@ -38,7 +45,7 @@ public function testCreateClientFromClientFactory()
38
45
$ factory = $ this ->getMockBuilder (ClientFactory::class)->getMock ();
39
46
$ factory ->method ('createClient ' )->willReturn ($ this ->client );
40
47
41
- $ subject = new ProfileClientFactory ($ factory , $ this ->collector , $ this ->formatter );
48
+ $ subject = new ProfileClientFactory ($ factory , $ this ->collector , $ this ->formatter , $ this -> stopwatch );
42
49
43
50
$ this ->assertInstanceOf (ProfileClient::class, $ subject ->createClient ());
44
51
}
@@ -49,7 +56,7 @@ public function testCreateClientFromCallable()
49
56
return $ this ->client ;
50
57
};
51
58
52
- $ subject = new ProfileClientFactory ($ factory , $ this ->collector , $ this ->formatter );
59
+ $ subject = new ProfileClientFactory ($ factory , $ this ->collector , $ this ->formatter , $ this -> stopwatch );
53
60
54
61
$ this ->assertInstanceOf (ProfileClient::class, $ subject ->createClient ());
55
62
}
0 commit comments