@@ -74,7 +74,7 @@ public function testVerifyMagicMethods()
74
74
75
75
public function testverifyWithMutliplesParams ()
76
76
{
77
- $ this ->specify ('works for instance proxy ' , function () {
77
+ $ this ->specify ('works for instance proxy ' , function () {
78
78
// Set up user object.
79
79
$ user = new UserModel (['name ' => "John Smith " ]);
80
80
double::registerObject ($ user );
@@ -85,20 +85,29 @@ public function testverifyWithMutliplesParams()
85
85
86
86
// Assert rename was counted.
87
87
$ user ->verifyInvoked ('setName ' , "Bob Jones " );
88
+ // if verifyInvoked is ok, verifyNeverInvoked have to fail
89
+ try {
90
+ $ user ->verifyNeverInvoked ('setName ' , "Bob Jones " );
91
+ // If i dont fail, my test fail
92
+ throw new fail ('verifyNeverInvoked ' );
93
+ } catch (\Exception $ e ) {}
94
+
88
95
$ user ->verifyNeverInvoked ('setName ' , ["Boby Jones " ]);
89
96
90
97
// call function with multiple params
91
98
$ user ->setNameAndInfo ("Bob Jones " , "Infos " );
92
99
93
100
// verify
94
- $ user ->verifyInvoked ('setNameAndInfo ' ,["Bob Jones " , "Infos " ]);
101
+ $ user ->verifyInvoked ('setNameAndInfo ' , ["Bob Jones " , "Infos " ]);
95
102
96
103
// if verifyInvoked is ok, verifyNeverInvoked have to fail
97
104
try {
98
105
$ user ->verifyNeverInvoked ('setNameAndInfo ' , ["Bob Jones " , "Infos " ]);
99
106
// If i dont fail, my test fail
100
107
throw new fail ('verifyNeverInvoked ' );
101
- } catch (\Exception $ e ) {}
108
+ } catch (\Exception $ e ) {
109
+
110
+ }
102
111
});
103
112
}
104
113
}
0 commit comments