From 3c837e4ad8338ed22d6030fe0ccbc6cbc3ea2049 Mon Sep 17 00:00:00 2001 From: Rich Lott Date: Mon, 16 Oct 2017 16:32:22 +0100 Subject: [PATCH] Include explanation about rebuilding schema in tests --- src/CRM/CivixBundle/Resources/views/Code/test-api.php.php | 6 +++++- .../CivixBundle/Resources/views/Code/test-headless.php.php | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/CRM/CivixBundle/Resources/views/Code/test-api.php.php b/src/CRM/CivixBundle/Resources/views/Code/test-api.php.php index 55bec374..a5f280cc 100644 --- a/src/CRM/CivixBundle/Resources/views/Code/test-api.php.php +++ b/src/CRM/CivixBundle/Resources/views/Code/test-api.php.php @@ -18,9 +18,13 @@ class extends \PHPUnit_Framework_TestCase implement * See: https://github.com/civicrm/org.civicrm.testapalooza/blob/master/civi-test.md */ public function setUpHeadless() { + + // If you muck up your schema somehow you may want to set this to true for one run. + $force_schema_reinstall = FALSE; + return \Civi\Test::headless() ->installMe(__DIR__) - ->apply(); + ->apply($force_schema_reinstall); } /** diff --git a/src/CRM/CivixBundle/Resources/views/Code/test-headless.php.php b/src/CRM/CivixBundle/Resources/views/Code/test-headless.php.php index e41b0685..5c4035a0 100644 --- a/src/CRM/CivixBundle/Resources/views/Code/test-headless.php.php +++ b/src/CRM/CivixBundle/Resources/views/Code/test-headless.php.php @@ -31,9 +31,13 @@ class extends \PHPUnit_Framework_TestCase implements He public function setUpHeadless() { // Civi\Test has many helpers, like install(), uninstall(), sql(), and sqlFile(). // See: https://github.com/civicrm/org.civicrm.testapalooza/blob/master/civi-test.md + + // If you muck up your schema somehow you may want to set this to true for one run. + $force_schema_reinstall = FALSE; + return \Civi\Test::headless() ->installMe(__DIR__) - ->apply(); + ->apply($force_schema_reinstall); } public function setUp() {