I have tbl_test table with this structure: ID:PK,AI; name:varchar ; family:varchar;
And have th following method in tests/unit/TestTest.php:
public function testARCreate()
{
$newUser=new Test;
$newUser->setAttributes(array(
'name' => 'your name',
'family' => 'your family',
)
);
$newUser->save();
}
The above code just insert ID attribute that created automately by DBMS, and name and family are empty in the DBMS. but following code work correctly:
public function testARCreate()
{
$newUser=new Test;
$newUser->name='your name';
$newUser->family='your family';
$newUser->save();
}
Is any one for help? thanks