public function testBeforeCreateException() { try { $test = new UnitTest(array('integer_value' => '123', 'string_value' => 'before create test', 'email_value' => '*****@*****.**')); $test->saveEx(); $this->fail(); } catch (Mad_Model_Exception_Validation $e) { // validation errors $this->assertEquals(1, count($test->errors)); foreach ($test->errors->fullMessages() as $msg) { $this->assertEquals('String value cannot be renamed to before create test', $msg); } } }