public function testGetInputFilter()
 {
     $comment = new Comment();
     $if = $comment->getInputFilter();
     $this->assertInstanceOf("Zend\\InputFilter\\InputFilter", $if);
     return $if;
 }
 public function saveAction()
 {
     $form = new CommentForm();
     $tableGateway = $tableGateway = $this->getServiceLocator()->get('Application\\Model\\CommentTableGateway');
     $request = $this->getRequest();
     if ($request->isPost()) {
         $comment = new CommentModel();
         $form->setInputFilter($comment->getInputFilter());
         $form->setData($request->getPost());
         if ($form->isValid()) {
             $data = $form->getData();
             $data['comment_date'] = date('Y-m-d H:i:s');
             $comment->exchangeArray($data);
             $tableGateway->save($comment);
             return $this->redirect()->toUrl('/comment/list');
         }
     }
     $id = (int) $this->params()->fromRoute('id', 0);
     if ($id > 0) {
         $comment = $tableGateway->get($id);
         $form->bind($comment);
         $form->get('submit')->setAttribute('value', 'Edit');
     }
     return new ViewModel(array('form' => $form));
 }