added tests and updated to yii edge