PMA_VERSION, 'db' => 'pmadb', 'users' => 'users', 'usergroups' => 'usergroups', ]; } /** * 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'; $dbi = $this->getMockBuilder(DatabaseInterface::class) ->disableOriginalConstructor() ->getMock(); $dbi->expects($this->once()) ->method('tryQuery') ->with($expectedQuery) ->will($this->returnValue(true)); $dbi->expects($this->once()) ->method('numRows') ->withAnyParameters() ->will($this->returnValue(0)); $dbi->expects($this->once()) ->method('freeResult'); $GLOBALS['dbi'] = $dbi; $html = UserGroups::getHtmlForUserGroupsTable(); $this->assertStringNotContainsString( '