示例#1
0
 public function testGetRolesFetchRowFailure()
 {
     $uid = 123;
     $this->resourceMock->expects($this->once())->method('getConnection')->willReturn($this->dbAdapterMock);
     $this->userMock->expects($this->atLeastOnce())->method('getId')->willReturn($uid);
     $this->dbAdapterMock->expects($this->once())->method('select')->willReturn($this->selectMock);
     $this->selectMock->expects($this->once())->method('from')->willReturn($this->selectMock);
     $this->selectMock->expects($this->once())->method('joinLeft')->willReturn($this->selectMock);
     $this->selectMock->expects($this->once())->method('where')->willReturn($this->selectMock);
     $this->dbAdapterMock->expects($this->once())->method('fetchCol')->willReturn(false);
     $this->assertEquals([], $this->model->getRoles($this->userMock));
 }