MockAuthAdapter.php 743 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * Lithium: the most rad php framework
  4. *
  5. * @copyright Copyright 2009, Union of RAD (http://union-of-rad.org)
  6. * @license http://opensource.org/licenses/bsd-license.php The BSD License
  7. */
  8. namespace lithium\tests\mocks\security\auth\adapter;
  9. class MockAuthAdapter extends \lithium\core\Object {
  10. public function check($credentials, array $options = array()) {
  11. switch (true) {
  12. case isset($options['success']):
  13. return $credentials;
  14. case isset($options['keyOnly']):
  15. return $credentials['id'];
  16. }
  17. return false;
  18. }
  19. public function set($data, array $options = array()) {
  20. if (isset($options['fail'])) {
  21. return false;
  22. }
  23. return $data;
  24. }
  25. public function clear(array $options = array()) {
  26. }
  27. }
  28. ?>