I,m doing a tutorial application with yii framework. When I tried to run an unit test I got this error in command line
Parse error: syntax error, unexpected T_DOUBLE_ARROW in /Applications/MAMP/htdocs/trackstar/protected/tests/unit/ProjectTest.php on line 11
Here is my code. I didn’t find the problem in my code . Can anyone help ?
class ProjectTest extends CDbTestCase
{
public function testCRUD()
{
//Create a new project
$newProject=new Project;
$newProjectName = 'Test Project 1';
$newProject->setAttributes(
array(
'name' => $newProjectName,
'description' => 'Test project number one',
'create_time' => '2010-01-01 00:00:00',
'create_user_id' => 1,
'update_time' => '2010-01-01 00:00:00',
'update_user_id' => 1,
)
);
$this->assertTrue($newProject->save(false));
}
}
There’s some kind of an unprintable character before your “array” keyword, just delete that one and it will be working
You won’t see the difference, but it’s there