Look up the difference between the 'required' rule and the 'notempty'
rule.

http://book.cakephp.org/view/129/required

-jperras.

On Jun 7, 9:14 am, williamn <[email protected]> wrote:
> Hi all,
>
> I have a simple model like below
>
> class Department extends AppModel {
>
>         var $name = 'Department';
>         var $validate = array(
>                 'code' => array('notempty'),
>                 'name' => array('notempty'),
>                 'abbreviation' => array('notempty'),
>                 'phone_num' => array('notempty')
>         );
>
> }
>
> and create a simple test like this
>
> function testInvalidCreate() {
>         $this->Department->create();
>         $this->assertFalse($this->Department->save());
>
> }
>
> correct me if I'm wrong, $this->Department->save() should return false
> right? but in my case it returning an array.
>
> Any suggestion?
>
> Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to