lithium\tests\cases\data\ModelTest::testSaveFailedWithValidationByModelDefinition PHP Method

testSaveFailedWithValidationByModelDefinition() public method

    public function testSaveFailedWithValidationByModelDefinition()
    {
        $post = MockPostForValidates::create();
        $result = $post->save();
        $this->assertFalse($result);
        $result = $post->errors();
        $this->assertNotEmpty($result);
        $expected = array('title' => array('please enter a title'), 'email' => array('email is empty', 'email is not valid'));
        $result = $post->errors();
        $this->assertEqual($expected, $result);
    }
ModelTest