From e4ccda28319ef96634a194d3e3d667ad62385b86 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Sun, 8 Feb 2015 14:50:13 -0800 Subject: [PATCH] CRM_Core_ManagedEntitiesTest - Fix compat w/drupal-demo. Use transactions. --- tests/phpunit/CRM/Core/ManagedEntitiesTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/CRM/Core/ManagedEntitiesTest.php b/tests/phpunit/CRM/Core/ManagedEntitiesTest.php index 71383b04bb..0c1e2be9cc 100644 --- a/tests/phpunit/CRM/Core/ManagedEntitiesTest.php +++ b/tests/phpunit/CRM/Core/ManagedEntitiesTest.php @@ -24,13 +24,15 @@ class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase { protected $fixtures; public function setUp() { + $this->useTransaction(TRUE); parent::setUp(); $this->modules = array( 'one' => new CRM_Core_Module('com.example.one', TRUE), 'two' => new CRM_Core_Module('com.example.two', TRUE), ); - $this->assertDBQuery(0, 'SELECT count(*) FROM civicrm_managed'); - $this->assertDBQuery(0, 'SELECT count(*) FROM civicrm_option_value WHERE name like "CRM_Example_%"'); + + // Testing on drupal-demo fails because some extensions have mgd ents. + CRM_Core_DAO::singleValueQuery('DELETE FROM civicrm_managed'); $this->fixtures['com.example.one-foo'] = array( 'module' => 'com.example.one', @@ -60,8 +62,6 @@ class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase { public function tearDown() { parent::tearDown(); - CRM_Core_DAO::singleValueQuery('DELETE FROM civicrm_managed'); - CRM_Core_DAO::singleValueQuery('DELETE FROM civicrm_option_value WHERE name like "CRM_Example_%"'); \Civi\Core\Container::singleton(TRUE); } -- 2.25.1