-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mocking an local object variable #4
Comments
New test classes generate a mocked object for use when testing. By default, only
Instead of calling |
@Frogli were you able to get this sorted out? |
@barkingfoodog No I am sorry, unfortunately not. I hope I can look at it this week. |
👍 No worries! Let me know if you get stuck. |
A question about the mocking mechanism in OmnisTAP:
I noticed that for every test class in the
$setup
gets a line where a mock of the production classDo $cinst.$mock($objects.oTree) Returns iorMock
This got me confused how the mocking system is working. In my perception you only mock the objects which you do not want to test and want to communicate to eg a database. I looked at the example and there also the production class is mocked, certain methods are mocked, the method to test is called and then the mocks are asserted.
Let say I want to mock a object used as a local variable in an object. How do I do that? With UnitTest framwork based on OmnisUnitTest. I do something like this:
I presume that this should be possible with OmnisTAP, but I did not get it working yet. Below an example of my failed attempt.
Could you help me with this. What am I missing?
The text was updated successfully, but these errors were encountered: