Model-layer validation in Doctrine, Symfony
- by Andree
Hi there,
I have a schema.yml containing something similiar to the following:
Character:
tableName: characters
actAs: { Timestampable: ~ }
columns:
id: { type: integer(4), primary: true, autoincrement: true }
name: { type: string(255), notnull: true, notblank: true, minlength: 3 }
I define the minlength of the column name to be 3. I created a unit test to test the minlength validation, and I found out that the validation is not working.
$character = new Character();
$character->set('name', 'Dw');
$t->ok(! $character->isValid()); # This test failed
Can someone tell me what might be the problem here?
Thanks,
Andree