Phalcon\Test\Integration\ValidationCest::appendValidationMessageToTheNonObject PHP Method

appendValidationMessageToTheNonObject() public method

Tests the get
Since: 2016-06-27
Author: Serghei Iakovlev ([email protected])
public appendValidationMessageToTheNonObject ( IntegrationTester $I )
$I IntegrationTester
    public function appendValidationMessageToTheNonObject(IntegrationTester $I)
    {
        $myValidator = new PresenceOf();
        $validation = new Validation();
        $validation->bind(new \stdClass(), ['day' => date('d'), 'month' => date('m'), 'year' => date('Y') + 1]);
        $myValidator->validate($validation, 'foo');
        $expectedMessages = Group::__set_state(['_position' => 0, '_messages' => [new Message('Field foo is required', 'foo', 'PresenceOf', 0)]]);
        $I->assertEquals($expectedMessages, $validation->getMessages());
    }