CiviEndToEndTestcase - Base class
authorTim Otten <totten@civicrm.org>
Tue, 23 Aug 2016 07:20:26 +0000 (00:20 -0700)
committerTim Otten <totten@civicrm.org>
Tue, 23 Aug 2016 21:07:09 +0000 (14:07 -0700)
CRM/Core/ClassLoader.php
tests/README.md
tests/phpunit/CiviTest/CiviEndToEndTestCase.php [new file with mode: 0644]

index cbd3799f29b825fe22c0c52f69118d3127579bd9..9bbcd0fbb5c5e7aaf93ba0301652d75cf086932d 100644 (file)
@@ -79,6 +79,7 @@ class CRM_Core_ClassLoader {
       'CiviSeleniumTestCase',
       'CiviTestSuite',
       'CiviUnitTestCase',
+      'CiviEndToEndTestCase',
       'Contact',
       'ContributionPage',
       'Custom',
index e5fe2ab941eab54c0dd6eb4fd69f573170bac1c1..d48407dd465ada59842a3dda0f157f37d87583ad 100644 (file)
@@ -28,7 +28,7 @@ and fill in missing test data:
 | PHPUnit |`api_v3_AllTests`|`headless`|Agnostic|`CiviUnitTestCase`|Requires `CIVICRM_UF=UnitTests`|
 | PHPUnit |`Civi\AllTests`|`headless`|Agnostic|`CiviUnitTestCase`|Requires `CIVICRM_UF=UnitTests`|
 | PHPUnit |`CRM_AllTests`|`headless`|Agnostic|`CiviUnitTestCase`|Requires `CIVICRM_UF=UnitTests`|
-| PHPUnit |`E2E_AllTests`|`e2e`|Agnostic|`PHPUnit_Framework_TestCase`|Useful for command-line scripts and web-services|
+| PHPUnit |`E2E_AllTests`|`e2e`|Agnostic|`CiviEndToEndTestCase`|Useful for command-line scripts and web-services|
 | PHPUnit |`WebTest_AllTests`|`e2e`|Drupal|`CiviSeleniumTestCase`|Useful for tests which require a full web-browser|
 | Karma ||`unit`|Agnostic|||
 | QUnit ||`e2e`|Agnostic||Run each test in a browser. See README.|
diff --git a/tests/phpunit/CiviTest/CiviEndToEndTestCase.php b/tests/phpunit/CiviTest/CiviEndToEndTestCase.php
new file mode 100644 (file)
index 0000000..27350c3
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+
+/**
+ * Class CiviEndToEndTestCase
+ *
+ * An end-to-end test case in which we have booted Civi+CMS and loaded the
+ * admin user in the local process.
+ *
+ * Note: If you need to work as a different user, try using `cv()` or
+ * a web-service.
+ */
+class CiviEndToEndTestCase extends PHPUnit_Framework_TestCase implements \Civi\Test\EndToEndInterface {
+
+  protected function setUp() {
+    CRM_Core_Config::singleton(1, 1);
+    CRM_Utils_System::loadBootStrap(array(
+      'name' => $GLOBALS['_CV']['ADMIN_USER'],
+      'pass' => $GLOBALS['_CV']['ADMIN_PASS'],
+    ));
+
+    parent::setUp();
+  }
+
+}