If possible, it would be nice to test some methods in ActiveRecord models without supplying a complete database fixture. Is the only alternative to mock the database connection class?
If possible, it would be nice to test some methods in ActiveRecord models without supplying a complete database fixture. Is the only alternative to mock the database connection class?
To make things even worse for mocking, components are read-only.
Meh, I’ll just move anything non-db related to service classes instead.
Is this issue solved in Yii 3, by the way?
Or maybe a solution can be to create an interface that extends your model, and then use this interface instead in your service classes?