@@ -71,4 +71,43 @@ public function testVerifyMagicMethods()
7171 $ user ->verifyInvoked ('renameUser ' );
7272 });
7373 }
74+
75+ public function testverifyWithMutliplesParams ()
76+ {
77+ $ this ->specify ('works for instance proxy ' , function () {
78+ // Set up user object.
79+ $ user = new UserModel (['name ' => "John Smith " ]);
80+ double::registerObject ($ user );
81+ $ user = new InstanceProxy ($ user );
82+
83+ // Rename the user
84+ $ user ->setName ("Bob Jones " );
85+
86+ // Assert rename was counted.
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+
95+ $ user ->verifyNeverInvoked ('setName ' , ["Boby Jones " ]);
96+
97+ // call function with multiple params
98+ $ user ->setNameAndInfo ("Bob Jones " , "Infos " );
99+
100+ // verify
101+ $ user ->verifyInvoked ('setNameAndInfo ' , ["Bob Jones " , "Infos " ]);
102+
103+ // if verifyInvoked is ok, verifyNeverInvoked have to fail
104+ try {
105+ $ user ->verifyNeverInvoked ('setNameAndInfo ' , ["Bob Jones " , "Infos " ]);
106+ // If i dont fail, my test fail
107+ throw new fail ('verifyNeverInvoked ' );
108+ } catch (\Exception $ e ) {
109+
110+ }
111+ });
112+ }
74113}
0 commit comments