if (
// Only load classes that clearly belong to CiviCRM.
// Note: api/v3 does not use classes, but api_v3's test-suite does
- (0 === strncmp($class, 'CRM_', 4) || 0 === strncmp($class, 'api_v3_', 7) || 0 === strncmp($class, 'WebTest_', 8)) &&
+ (0 === strncmp($class, 'CRM_', 4) || 0 === strncmp($class, 'api_v3_', 7) || 0 === strncmp($class, 'WebTest_', 8) || 0 === strncmp($class, 'E2E_', 4)) &&
// Do not load PHP 5.3 namespaced classes.
// (in a future version, maybe)
FALSE === strpos($class, '\\')
--- /dev/null
+<?php
+/*
+ +--------------------------------------------------------------------+
+ | CiviCRM version 4.7 |
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC (c) 2004-2016 |
+ +--------------------------------------------------------------------+
+ | This file is a part of CiviCRM. |
+ | |
+ | CiviCRM is free software; you can copy, modify, and distribute it |
+ | under the terms of the GNU Affero General Public License |
+ | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
+ | |
+ | CiviCRM is distributed in the hope that it will be useful, but |
+ | WITHOUT ANY WARRANTY; without even the implied warranty of |
+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
+ | See the GNU Affero General Public License for more details. |
+ | |
+ | You should have received a copy of the GNU Affero General Public |
+ | License and the CiviCRM Licensing Exception along |
+ | with this program; if not, contact CiviCRM LLC |
+ | at info[AT]civicrm[DOT]org. If you have questions about the |
+ | GNU Affero General Public License or the licensing of CiviCRM, |
+ | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ +--------------------------------------------------------------------+
+ */
+
+/**
+ * Include parent class definition
+ */
+require_once 'CiviTest/CiviTestSuite.php';
+
+/**
+ * Class containing all CRM test suites
+ *
+ * @package CiviCRM
+ */
+class E2E_AllTests extends CiviTestSuite {
+ private static $instance = NULL;
+
+ /**
+ */
+ private static function getInstance() {
+ if (is_null(self::$instance)) {
+ self::$instance = new self();
+ }
+ return self::$instance;
+ }
+
+ /**
+ * Build test suite dynamically.
+ */
+ public static function suite() {
+ $inst = self::getInstance();
+ return $inst->implSuite(__FILE__);
+ }
+
+}
array_shift($argv);
// Convert class names to file names
+$CIVICRM_UF = 'UnitTests';
foreach ($argv as $k => $v) {
- if (preg_match('/^(CRM_|api_v3_|EnvTest|WebTest_)/', $v)) {
+ if (preg_match('/^(CRM_|api_v3_|EnvTest|WebTest_|E2E_)/', $v)) {
$argv[$k] = 'tests/phpunit/' . strtr($v, '_', '/') . '.php';
}
elseif (preg_match('/^Civi\\\\/', $v)) {
$argv[$k] = 'tests/phpunit/' . strtr($v, '\\', '/') . '.php';
}
- if (!preg_match('/^(WebTest)/', $v)) {
- putenv('CIVICRM_UF=UnitTests');
+ if (preg_match('/^(WebTest|E2E)/', $v)) {
+ $CIVICRM_UF='';
}
}
+putenv("CIVICRM_UF=$CIVICRM_UF");
// Transition: Make sure we use phpunit code from PATH, not
// civicrm-packages. This will be unnecessary once civicrm-packages is