Commit a84e2e861039cd702058cd997add8ebbd4a78fc9

Authored by Neil Blakey-Milner
1 parent d2056459

Hand-usable tests for authentication functions


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4436 c91229c3-7414-0410-bfa2-8a42b809f60b
tests/authentication/authenticatorForSource.php 0 → 100644
  1 +<?php
  2 +
  3 +require_once("../../config/dmsDefaults.php");
  4 +require_once(KT_LIB_DIR . '/authentication/authenticationsource.inc.php');
  5 +require_once(KT_LIB_DIR . '/authentication/authenticationproviderregistry.inc.php');
  6 +
  7 +
  8 +$oSource = KTAuthenticationSource::get(2);
  9 +$sProvider = $oSource->getAuthenticationProvider();
  10 +$oRegistry = KTAuthenticationProviderRegistry::getSingleton();
  11 +$oProvider =& $oRegistry->getAuthenticationProvider($sProvider);
  12 +$oAuthenticator = $oProvider->getAuthenticator($oSource);
  13 +$oUser = User::getByUserName('nbm');
  14 +$foo = $oAuthenticator->checkPassword($oUser, 'asdfa');
  15 +var_dump($foo);
  16 +
  17 +?>
tests/authentication/checkPassword.php 0 → 100644
  1 +<?php
  2 +
  3 +require_once("../../config/dmsDefaults.php");
  4 +require_once(KT_LIB_DIR . '/authentication/authenticationutil.inc.php');
  5 +
  6 +$oUser =& User::getByUserName('nbm2');
  7 +$foo = KTAuthenticationUtil::checkPassword($oUser, 'asdfa');
  8 +var_dump($foo);
  9 +
  10 +?>