Add Some Helpers In Ctestcase

It would be nice to have some helper functions in CTestcase

For example to verify saving a model.




function verifyModelSave($model) {

    	if ($model->save() == false) {

	    print_r($model->getErrors());

	    $this->assertFalse(true, 'Failed to save model');

	}

}



I don’t think this kind of helper is commonly used.

For your tests you can create your own base class that extends from CTestCase and add those methods there.

Btw: it would be better to name that method assertModelSaved() to have same naming as other asserting methods.

Good point about calling it assertModelSaved().

Anyway it is sad to see an empty CTestcase class. I am sure there are some helper functions that you guys use that could belong there.

Here is a bunch for Yii itself https://github.com/Crisu83/yii-app/blob/master/app/helpers/global.php