public function testDeleteComment() { $count1 = CommentsActiveRecord::find()->count(); $comment = new CommentsActiveRecord(); $comment->userId = 1; $comment->photoId = 0; $comment->body = 'comment'; $comment->created = date("Y-m-d H-i-s"); $comment->save(); $controller = new SiteController(); $controller->actionDeletecomment($comment->id); $count2 = CommentsActiveRecord::find()->count(); $this->assert($count1, $count2, 'count before inserting and after deleting are not equals'); /*if($count1 != $count2){ $this->fire('myevent', new TestEvent($this)); }*/ }