A
A
Albert Tobacco2015-07-06 13:56:17
Yii
Albert Tobacco, 2015-07-06 13:56:17

How to test Yii2 cron?

I write cron, and in general, the main business logic of the application is wired in it.
I want to write tests for it. In general, I have never been involved in testing, perhaps for this reason I don’t understand exactly how to test a controller that inherited from

yii\console\controller;

I will be grateful for help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
matperez, 2015-07-06
@matperez

The controller does not need to be tested. Business logic needs to be placed in the model, and the methods of the model should already be called in the controller. The model itself can be tested using Unit Tests .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question