Hi, I am following Agile Web Application Development with Yii 1.1 and PHP5. On page 126 where i run the Unit tests for ‘tbl_user’ and ‘tbl_project_user_assignment’, I encounter the following error:
Failed asserting that 1 is true
trackstar\protected\tests\unit\ProjectTest.php:67
FAILURES!
Tests: 5, Assertions: 12, Failures: 1.
the function is as follows:
public function testGetUserOptions()
{
$project = $this->projects('project2');
$options = $project->userOptions;
$this->assertTrue(is_array($options));
$this->assertTrue(count($options > 0));
}
i believe the failure occurs with the line
$this->assertTrue(count($options > 0));
since all tests pass when i remove it.
the function being tested is as follows:
public function getUserOptions()
{
$usersArray = CHtml::listData($this->users, 'id', 'username');
return $usersArray;
}
Can anyone help?