Do Unit Tests should call real DIC or Fixtures?

Recently I wrote a reply to this post in which interesting classes for *unit* tests were presented. However I made some annotations as to the effect that I always learned from the top guys about testing:

hi there, I like the part that you talked about the Continuous Integration server application. However, i don’t think your tests are unit tests. The reason is that your tests should tend to be isolated into the logic of the test and not in loading interactions with other objects or the database. So to load specific data makes it sound more like functional testing. Specially when you load the DIC, rather I think objects and their methods should be mocked and stubbed. This of course is harder but it is the right way. What do you think?

Idea: Now if i am right it would be neat to create a class that can automatically perhaps implement the mocking or stubbing through the DIC.

http://blog.sznapka.pl/fully-isolated-tests-in-symfony2/comment-page-1/#comment-287

2 thoughts on “Do Unit Tests should call real DIC or Fixtures?

  1. Nice blog here! Also your web site quite a bit up fast!
    What web host are you the usage of? Can I am getting your associate hyperlink for your host?
    I want my web site loaded up as fast as yours lol

Leave a Reply

Your email address will not be published. Required fields are marked *