Dear,
This is about writing unit test.
Here is my fixture.
return array(
// 1
'sample1'=>array(
'name' => 'the sample 1',
), // 2
'sample2'=>array(
'name' => 'the sample 2',
),
);
and here is my unit test code.
class SampleTest extends CDbTestCase
{
public $fixtures = array(
'samples' => 'sample',
);
public function testCreate()
{
// this doesn't work
echo $this->samples['sample1']['id'];
// this work
echo $this->samples['sample1']['name'];
}
}
I had a problem getting id from those fixtures.
Any ideas?
Thanks in advance.