示例#1
0
 public function testGetsResourceAdmins()
 {
     $resourceId = 123;
     $repo = new UserRepository();
     $command = new GetAllResourceAdminsCommand($resourceId);
     $userRows = array($this->GetUserRow(1, 'admin', 'guy', 'email'), $this->GetUserRow(), $this->GetUserRow());
     $this->db->SetRows($userRows);
     $admins = $repo->GetResourceAdmins($resourceId);
     $admin = $admins[0];
     $this->assertEquals(3, count($admins));
     $this->assertEquals(1, $admin->Id());
     $this->assertEquals('admin', $admin->FirstName());
     $this->assertEquals('guy', $admin->LastName());
     $this->assertEquals($command, $this->db->_LastCommand);
 }