PMA_VERSION, 'db' => 'pmadb', 'users' => 'users', 'usergroups' => 'usergroups' ]; } /** * Tests UserGroups::getHtmlForUserGroupsTable() function when there are no user groups * * @return void * @group medium */ public function testGetHtmlForUserGroupsTableWithNoUserGroups() { $expectedQuery = "SELECT * FROM `pmadb`.`usergroups`" . " ORDER BY `usergroup` ASC"; $dbi = $this->getMockBuilder('PhpMyAdmin\DatabaseInterface') ->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->assertNotContains( '