File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types = 1 );
2
+
3
+ namespace PHPStan \Mockery ;
4
+
5
+ class Bar
6
+ {
7
+
8
+ /** @var Foo */
9
+ private $ foo ;
10
+
11
+ public function __construct (Foo $ foo )
12
+ {
13
+ $ this ->foo = $ foo ;
14
+ }
15
+
16
+ public function doFoo (): ?string
17
+ {
18
+ return $ this ->foo ->doFoo ();
19
+ }
20
+
21
+ }
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types = 1 );
2
+
3
+ namespace PHPStan \Mockery ;
4
+
5
+ class MockeryBarTest extends \PHPUnit \Framework \TestCase
6
+ {
7
+
8
+ /** @var \Mockery\MockInterface|Foo */
9
+ private $ fooMock ;
10
+
11
+ protected function setUp (): void
12
+ {
13
+ $ this ->fooMock = \Mockery::mock (Foo::class);
14
+ }
15
+
16
+ public function testFooIsCalled (): void
17
+ {
18
+ $ bar = new Bar ($ this ->fooMock );
19
+
20
+ $ this ->fooMock ->expects ()->doFoo ()->andReturn ('foo ' );
21
+ self ::assertSame ('foo ' , $ bar ->doFoo ());
22
+ }
23
+
24
+ }
You can’t perform that action at this time.
0 commit comments