@@ -66,13 +66,13 @@ public function testExpects()
6666 public function testHasMatcher ()
6767 {
6868 $ prophecy = $ this ->prophesize (MockObject::class);
69- $ prophecy ->__phpunit_hasMatchers ()->willReturn (" foo " );
69+ $ prophecy ->__phpunit_hasMatchers ()->willReturn (true );
7070 $ mock = $ prophecy ->reveal ();
7171
7272 $ proxy = new MockObjectProxy ($ mock );
7373
7474 $ result = $ proxy ->__phpunit_hasMatchers ();
75- $ this ->assertEquals ( " foo " , $ result );
75+ $ this ->assertTrue ( $ result );
7676 }
7777
7878 /**
@@ -84,16 +84,23 @@ public function testHasMatcher()
8484 * @test
8585 * @dataProvider provideTestProxiedMethods
8686 */
87- public function testProxiedMethods ($ method , array $ arguments = [], $ expected = " foo " )
87+ public function testProxiedMethods ($ method , array $ arguments = [], $ expected = null )
8888 {
8989 $ prophecy = $ this ->prophesize (MockObject::class);
90- call_user_func_array ([$ prophecy , $ method ], $ arguments )->willReturn ($ expected );
90+ if ($ expected ) {
91+ call_user_func_array ([$ prophecy , $ method ], $ arguments )->willReturn ($ expected )->shouldBeCalledTimes (1 );
92+ } else {
93+ call_user_func_array ([$ prophecy , $ method ], $ arguments )->shouldBeCalledTimes (1 );
94+ }
9195 $ mock = $ prophecy ->reveal ();
9296
9397 $ proxy = new MockObjectProxy ($ mock );
9498
9599 $ result = call_user_func_array ([$ proxy , $ method ], $ arguments );
96- $ this ->assertEquals ($ expected , $ result );
100+
101+ if ($ expected ) {
102+ $ this ->assertSame ($ expected , $ result );
103+ }
97104 }
98105
99106 /**
@@ -104,9 +111,9 @@ public function testProxiedMethods($method, array $arguments = [], $expected = "
104111 public function provideTestProxiedMethods ()
105112 {
106113 return [
107- [" __phpunit_getInvocationMocker " ],
108- [" __phpunit_setOriginalObject " , [" bar " ]],
109- [" __phpunit_verify " , [true ]],
114+ [' __phpunit_getInvocationMocker ' , [], new \ PHPUnit \ Framework \ MockObject \ InvocationMocker ([], true ) ],
115+ [' __phpunit_setOriginalObject ' , [' bar ' ]],
116+ [' __phpunit_verify ' , [true ]],
110117 ];
111118 }
112119}
0 commit comments