/** * Test for PMA\libraries\plugins\auth\AuthenticationHttp::authCheck * * @param string $user test username * @param string $pass test password * @param string $userIndex index to test username against * @param string $passIndex index to test username against * @param string $expectedReturn expected return value from test * @param string $expectedUser expected username to be set * @param string $expectedPass expected password to be set * @param string $old_usr value for $_REQUEST['old_usr'] * * @return void * @dataProvider authCheckProvider */ public function testAuthCheck($user, $pass, $userIndex, $passIndex, $expectedReturn, $expectedUser, $expectedPass, $old_usr = '') { $GLOBALS['PHP_AUTH_USER'] = ''; $GLOBALS['PHP_AUTH_PW'] = ''; $_SERVER[$userIndex] = $user; $_SERVER[$passIndex] = $pass; $_REQUEST['old_usr'] = $old_usr; $this->assertEquals($expectedReturn, $this->object->authCheck()); $this->assertEquals($expectedUser, $GLOBALS['PHP_AUTH_USER']); $this->assertEquals($expectedPass, $GLOBALS['PHP_AUTH_PW']); $_SERVER[$userIndex] = null; $_SERVER[$passIndex] = null; }