Example #1
0
 /**
  * test that validateErrors works with any old model.
  *
  * @return void
  */
 function testValidateErrorsOnArbitraryModels()
 {
     $TestController =& new TestController();
     $Post = new ControllerPost();
     $Post->validate = array('title' => 'notEmpty');
     $Post->set('title', '');
     $result = $TestController->validateErrors($Post);
     $expected = array('title' => 'This field cannot be left blank');
     $this->assertEqual($result, $expected);
 }
 /**
  * test that validateErrors works with any old model.
  *
  * @return void
  */
 public function testValidateErrorsOnArbitraryModels()
 {
     Configure::write('Config.language', 'eng');
     $TestController = new TestController();
     $Post = new ControllerPost();
     $Post->validate = array('title' => 'notEmpty');
     $Post->set('title', '');
     $result = $TestController->validateErrors($Post);
     $expected = array('title' => array('This field cannot be left blank'));
     $this->assertEquals($expected, $result);
 }