Hi! I m Juan from Argentina. Im started to work with yii2 like a year hago. Im usually read the forum, but this its my first question. I want to ask about tdd in yii2, i read a lot about this in general and in yii en particular. Im using codeception and started from the unit tests. I made a couple of tests with some work, and everything run very well. But i cant find deeper information about testing yii2 or mvc pattern in general. I glade to know about real cases of use, becouse all the examples that i can find meke a really simple test. I like to know:
All the questions are about models (this its all i tryed)
- How can i know that my test is valid? it is enough set the model with invalid data and and valid data with the correspondent assertions?
- Should i test the models with any conecction to de database in first place?
- How can i use gii? if tdd says that i should only write the minimun code to pas the test?
- It have any sense write test for models generated with gii?
- How i supouse to mock the realition between models?
i would like to see some real example of unit test in yii