Gii should generate Unit tests as well
Posted 13 April 2012 - 05:39 AM
Posted 13 April 2012 - 06:46 AM
EDIT: Wait. There are parts that are frequently customized by the developer and therefore could need an initial test like attributeLabels() etc.
Posted 13 April 2012 - 07:54 AM
Furthermore I agree with you that it would be an amazingly helpful feature, to generate fixture skeletons for ActiveRecords as well.
Posted 13 April 2012 - 10:09 AM
some people prefer to extend generated classes with their own, in this case unit tests for generated classes are rather undesirable
Posted 14 April 2012 - 04:26 PM
I don't think so. There are many reasons why this should be done, the two most important:
- it's a feature that every (serious) application needs
- it enforces people - who don't already do so - to create unit tests, leading to more stable software overall.
Posted 15 April 2012 - 12:06 AM
I also think it is more safe when you generating tests manually, because sometime you don't want to test some functions/features, that might already be tested, or for example you want to have two test function for one say model function(for example with regular and with invalid parameters, in case when your tests are very big, and you want to split them into two tests).
Posted 18 July 2012 - 04:39 AM