@@ -66,13 +66,13 @@ public function testExpects()
66
66
public function testHasMatcher ()
67
67
{
68
68
$ prophecy = $ this ->prophesize (MockObject::class);
69
- $ prophecy ->__phpunit_hasMatchers ()->willReturn (" foo " );
69
+ $ prophecy ->__phpunit_hasMatchers ()->willReturn (true );
70
70
$ mock = $ prophecy ->reveal ();
71
71
72
72
$ proxy = new MockObjectProxy ($ mock );
73
73
74
74
$ result = $ proxy ->__phpunit_hasMatchers ();
75
- $ this ->assertEquals ( " foo " , $ result );
75
+ $ this ->assertTrue ( $ result );
76
76
}
77
77
78
78
/**
@@ -84,16 +84,23 @@ public function testHasMatcher()
84
84
* @test
85
85
* @dataProvider provideTestProxiedMethods
86
86
*/
87
- public function testProxiedMethods ($ method , array $ arguments = [], $ expected = " foo " )
87
+ public function testProxiedMethods ($ method , array $ arguments = [], $ expected = null )
88
88
{
89
89
$ 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
+ }
91
95
$ mock = $ prophecy ->reveal ();
92
96
93
97
$ proxy = new MockObjectProxy ($ mock );
94
98
95
99
$ result = call_user_func_array ([$ proxy , $ method ], $ arguments );
96
- $ this ->assertEquals ($ expected , $ result );
100
+
101
+ if ($ expected ) {
102
+ $ this ->assertSame ($ expected , $ result );
103
+ }
97
104
}
98
105
99
106
/**
@@ -104,9 +111,9 @@ public function testProxiedMethods($method, array $arguments = [], $expected = "
104
111
public function provideTestProxiedMethods ()
105
112
{
106
113
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 ]],
110
117
];
111
118
}
112
119
}
0 commit comments