All of sudden, this happens, for the past 3 days, i have been struggling to go pass it but I can’t. I don’t know why the fixture wants to load but “project.php” file. Please below is picture and code. Please Help!
NetBeans Screenshot: Attached.
ProjectTest.php:
<?php
/* @var $this ProjectController */
class ProjectTest extends CDbTestCase
{
public $fixtures = array(
'projects' => 'project',
'users' => 'user',
'projUsrAssign' => ':tbl_project_user_assignment',
'projUserRole' => ':tbl_project_user_role',
);
public function testUserRoleAssignment(){
$project = $this->projects('project1');
$user = $this->users('user1');
$user2=$this->users('user2') ;
$this->assertEquals(1,$project->associateUserToRole('owner',$user->id));
$this->assertEquals(1,$project->associateUserToRole('member',$user2->id));
$this->assertEquals(1,$project->removeUserFromRole('owner', $user->id));
}
public function testIsInRole()
{
$row1 = $this->projUsrRole['row1'];
Yii::app()->user->setId($row1['user_id']);
$project=Project::model()->findByPk($row1['project_id']);
$this->assertTrue($project->isUserInRole('member'));
}
public function testUserAccessBasedOnProjectRole(){
$row1 = $this->projUsrRole['row1'];
Yii::app()->user->setId($row1['user_id']);
$project= Project::model()->findByPk($row1['project_id']);
$auth= Yii::app()->authManager;
$bizRule='return isset($params["project"]) && $params["project"]->isUserInRole("member");';
$auth->assign('member',$row1['user_id'],$bizRule);
$params=array('project'=>$project);
$this->assertTrue(Yii::app()->user->checkAccess('updateIssue', $params));
$this->assertTrue(Yii::app()->user->checkAccess('deleteIssue',$params));
}
}
?>
Any other thing needed … please ask.