configurableMenusFeature = new ConfigurableMenusFeature(
DatabaseName::fromValue('pmadb'),
TableName::fromValue('usergroups'),
TableName::fromValue('users')
);
}
/**
* Tests UserGroups::getHtmlForUserGroupsTable() function when there are no user groups
*
* @group medium
*/
public function testGetHtmlForUserGroupsTableWithNoUserGroups(): void
{
$expectedQuery = 'SELECT * FROM `pmadb`.`usergroups` ORDER BY `usergroup` ASC';
$resultStub = $this->createMock(DummyResult::class);
$dbi = $this->getMockBuilder(DatabaseInterface::class)
->disableOriginalConstructor()
->getMock();
$dbi->expects($this->once())
->method('tryQueryAsControlUser')
->with($expectedQuery)
->will($this->returnValue($resultStub));
$resultStub->expects($this->once())
->method('numRows')
->will($this->returnValue(0));
$GLOBALS['dbi'] = $dbi;
$html = UserGroups::getHtmlForUserGroupsTable($this->configurableMenusFeature);
$this->assertStringNotContainsString('