3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2017
37 * Helper authentication class for unit tests
39 class CRM_Utils_System_UnitTests
extends CRM_Utils_System_Base
{
42 public function __construct() {
43 $this->is_drupal
= FALSE;
44 $this->supports_form_extensions
= FALSE;
50 public function authenticate($name, $password, $loadCMSBootstrap = FALSE, $realPath = NULL) {
51 $retVal = array(1, 1, 12345);
56 * Bootstrap the phony CMS.
59 * Optional username for login.
61 * Optional password for login.
65 public function loadBootStrap($name = NULL, $pass = NULL) {
72 public function mapConfigToSSL() {
74 $base_url = str_replace('http://', 'https://', $base_url);
80 public function postURL($action) {
96 $config = CRM_Core_Config
::singleton();
97 static $script = 'index.php';
99 if (isset($fragment)) {
100 $fragment = '#' . $fragment;
103 if (!isset($config->useFrameworkRelativeBase
)) {
104 $base = parse_url($config->userFrameworkBaseURL
);
105 $config->useFrameworkRelativeBase
= $base['path'];
107 $base = $absolute ?
$config->userFrameworkBaseURL
: $config->useFrameworkRelativeBase
;
109 $separator = $htmlize ?
'&' : '&';
111 if (!$config->cleanURL
) {
114 return $base . $script . '?q=' . $path . $separator . $query . $fragment;
117 return $base . $script . '?q=' . $path . $fragment;
122 return $base . $script . '?' . $query . $fragment;
125 return $base . $fragment;
132 return $base . $path . '?' . $query . $fragment;
135 return $base . $path . $fragment;
140 return $base . $script . '?' . $query . $fragment;
143 return $base . $fragment;
152 public function getUserID($user) {
153 //FIXME: look here a bit closer when testing UFMatch
155 // this puts the appropriate values in the session, so
156 // no need to return anything
157 CRM_Core_BAO_UFMatch
::synchronize($user, TRUE, 'Standalone', 'Individual');
163 public function logout() {
165 CRM_Utils_System
::setHttpHeader("Location", "index.php");
171 public function getLoginURL($destination = '') {
172 throw new Exception("Method not implemented: getLoginURL");