Skip to content

Commit 4225c7c

Browse files
committed
Add test for verifying instance magic methods
1 parent 3a2c3ce commit 4225c7c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/unit/VerifierTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,18 @@ public function testVerifyMagicMethods()
5757
// Assert rename was counted.
5858
$userProxy->verifyInvoked('renameUser');
5959
});
60+
61+
$this->specify('works for instance proxy', function() {
62+
// Set up user object.
63+
$user = new UserModel(['name'=>"John Smith"]);
64+
double::registerObject($user);
65+
$user = new InstanceProxy($user);
66+
67+
// Rename the user via magic method.
68+
$user->renameUser("Bob Jones");
69+
70+
// Assert rename was counted.
71+
$user->verifyInvoked('renameUser');
72+
});
6073
}
6174
}

0 commit comments

Comments
 (0)