dao = StaticContainer::get(RecoveryCodeDao::class); $this->settings = new SystemSettings(); $secretGenerator = new TwoFaSecretRandomGenerator(); $this->twoFa = new TwoFactorAuthentication($this->settings, $this->dao, $secretGenerator); self::$fixture->loginAsSuperUser(); } public function test_onRequestDispatchEnd_notRequired() { $this->settings->twoFactorAuthRequired->setValue(true); $html = ''.Piwik::getCurrentUserTokenAuth().''; $expected = ''.Piwik::getCurrentUserTokenAuth().''; Piwik::postEvent('Request.dispatch.end', array(&$html, 'module', 'action', array())); $this->assertSame($expected, $html); } public static function getOutputPrefix() { return ''; } public static function getPathToTestDirectory() { return dirname(__FILE__); } } TwoFactorAuthTest::$fixture = new SimpleFixtureTrackFewVisits();