Relative Content

Tag Archive for phpunit-testingtestingautomated-testsphpunit

How can I test that the PHP code under test calls the proper method on a trait?

I usually use dependency injection (DI), but want to get better with traits since they seem like they can fulfill a similar role while still using composition instead of inheritance. The issue I’m running into is I cannot figure out the best way to make sure that the code under test (CUT) is properly calling methods on said trait – this seems similar to the issues I’ve run into in the past with inheritance?