/** * @param string $username * @throws InvalidResponseException */ public function removeCollaborator($username) { foreach ($this->configProvider->getTeams() as $team) { try { $id = $this->getTeamId($team); $this->getTeamsApi()->removeMember($id, $username); } catch (ExceptionInterface $e) { $message = "Can't remove user \"{$username}\" from GitHub team \"{$team}\"."; throw InvalidResponseException::create($message, $e); } } }
/** * @dataProvider getTeamsDataProvider */ public function testGetTeams($teams, $expected) { $this->configManager->expects($this->once())->method('get')->with(ConfigurationProvider::TEAMS_FIELD)->will($this->returnValue($teams)); $actual = $this->provider->getTeams(); $this->assertEquals($expected, $actual); }