i'm trying write tests controller , rather dependent on output html (which front-end developer no doubt tinker with) want make sure front-end developer has data need.
how access array of data handed template in phpunit test can verify it? i've trawled web (incl. so) , docs no avail.
i know fake call controller rather use web crawler, best way it?
controllers high level code. should not try write unit tests directly controller methods. controllers wire low level classes, should focus on unit testing these classes. if have business logic inside controller needs testing, should consider refactoring action.
so suggestion use functional tests test controllers , use unit-tests test models , business logic stuff.
if struggle functional tests, can read following:
Comments
Post a Comment