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

testValidatesCustomEventsFirstValid() public method

    public function testValidatesCustomEventsFirstValid()
    {
        $post = MockPostForValidates::create(array('title' => 'new post', 'email' => '[email protected]'));
        $events = array('customEvent', 'anotherCustomEvent');
        $result = $post->validates(compact('events'));
        $this->assertFalse($result);
        $result = $post->errors();
        $this->assertNotEmpty($result);
        $expected = array('email' => array('email is not in 2nd list'));
        $result = $post->errors();
        $this->assertEqual($expected, $result);
    }
ModelTest