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

testValidateWithRequiredNull() public method

    public function testValidateWithRequiredNull()
    {
        $validates = array('title' => 'A custom message here for empty titles.', 'email' => array(array('notEmpty', 'message' => 'email is empty.', 'required' => null)));
        $post = MockPost::create(array('title' => 'post title'));
        $post->validates(array('rules' => $validates));
        $this->assertNotEmpty($post->errors());
        $post->sync(1);
        $post->validates(array('rules' => $validates));
        $this->assertEmpty($post->errors());
    }
ModelTest