AuthenticationCookieTest::testAuthCheckAuthFails PHP Метод

testAuthCheckAuthFails() публичный Метод

Test for PMA\libraries\plugins\auth\AuthenticationConfig::authCheck (mocking the object itself)
public testAuthCheckAuthFails ( ) : void
Результат void
    public function testAuthCheckAuthFails()
    {
        $GLOBALS['server'] = 1;
        $_REQUEST['old_usr'] = '';
        $_REQUEST['pma_username'] = '';
        $_COOKIE['pmaServer-1'] = 'pmaServ1';
        $_COOKIE['pmaUser-1'] = 'pmaUser1';
        $_COOKIE['pma_iv-1'] = base64_encode('testiv09testiv09');
        $GLOBALS['cfg']['blowfish_secret'] = 'secret';
        $_SESSION['last_access_time'] = 1;
        $GLOBALS['cfg']['CaptchaLoginPrivateKey'] = '';
        $GLOBALS['cfg']['CaptchaLoginPublicKey'] = '';
        $GLOBALS['cfg']['LoginCookieValidity'] = 0;
        $_SESSION['last_access_time'] = -1;
        // mock for blowfish function
        $this->object = $this->getMockBuilder('PMA\\libraries\\plugins\\auth\\AuthenticationCookie')->disableOriginalConstructor()->setMethods(array('authFails'))->getMock();
        $this->object->expects($this->once())->method('authFails');
        $this->assertFalse($this->object->authCheck());
        $this->assertTrue($GLOBALS['no_activity']);
    }