Well i started out early working through Agile Web Application Development with Yii and PHP. Anyway i got stuck on installing PEAR, then it looked like it installed, and i was working on PHPUnit and that looked like it installed but i was continuously getting errors and fixing errors. After hours and hours of going through online help and getting error after error i got to the point at which there was no more help. I was completely stressed out, i had been working on this for around 5 hours, i had a major headache. I don't know about PEARS, but this was driving me Banana's. I decided after a short break that the best thing would be to reinstall install XAMPP completely, so i downloaded there most up to date version. Finally after i got that installed, i found that PEAR and PHPUnit were already all setup, i was like whall this is just amazing, i spend almost 6 hours messing around and then it all works in one go with the new XAMPP. Well regardless of what happened i did feel satisfied when i finally got it installed after all that time spent.
Okay for those of you working through Yii, i have a question, im on page.70 (Agile Web Application Development with Yii and PHP), using PHPUnit to run a test on a ProjectTest.php
in command prompt we need to type in
% cd Webroot/protected/tests
% phpunit unit/ProjectTest.php in
after running this im getting an error
Parse error: syntax error, unexpected T_VARIABLE C:\xampp\htdocs\yii\trackstar\protected\tests\unit\ProjectTest.php on line 8
here is a copy of ProjectTest.php
<?php
class ProjectTest extends CDbTestCase
{
public function testCRUD()
{
//Create a new project
$newProject=new Project
$newProjectName = 'Test Project 1'; // Line 8
$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));
}
}
Do you know what the problem is here?











