From c820accff57c92199f71ff2b7bf3cdc4f5a852b6 Mon Sep 17 00:00:00 2001 From: Rich Lott / Artful Robot Date: Fri, 29 Sep 2023 16:54:26 +0100 Subject: [PATCH] standalone: remove switch UF Classes calls in test - seem not needed --- .../tests/phpunit/Civi/Standalone/SecurityTest.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ext/standaloneusers/tests/phpunit/Civi/Standalone/SecurityTest.php b/ext/standaloneusers/tests/phpunit/Civi/Standalone/SecurityTest.php index af42e0bd09..b96330fc2b 100644 --- a/ext/standaloneusers/tests/phpunit/Civi/Standalone/SecurityTest.php +++ b/ext/standaloneusers/tests/phpunit/Civi/Standalone/SecurityTest.php @@ -50,7 +50,7 @@ class SecurityTest extends \PHPUnit\Framework\TestCase implements EndToEndInterf public function tearDown():void { $this->deleteStuffWeMade(); - $this->switchBackFromOurUFClasses(TRUE); + // $this->switchBackFromOurUFClasses(TRUE); parent::tearDown(); } @@ -113,14 +113,14 @@ class SecurityTest extends \PHPUnit\Framework\TestCase implements EndToEndInterf ->addWhere('id', '=', $userID) ->execute(); - $this->switchToOurUFClasses(); + // $this->switchToOurUFClasses(); foreach (['access CiviCRM', 'view all contacts', 'add contacts', 'edit all contacts'] as $allowed) { $this->assertTrue(\CRM_Core_Permission::check([$allowed], $contactID), "Should have '$allowed' permission but don't"); } foreach (['administer CiviCRM', 'access uploaded files'] as $notAllowed) { $this->assertFalse(\CRM_Core_Permission::check([$notAllowed], $contactID), "Should NOT have '$allowed' permission but do"); } - $this->switchBackFromOurUFClasses(); + // $this->switchBackFromOurUFClasses(); } protected function switchToOurUFClasses() { @@ -144,7 +144,10 @@ class SecurityTest extends \PHPUnit\Framework\TestCase implements EndToEndInterf $this->originalUFPermission = $this->originalUF = NULL; } - public function dump(string $s = '') { + /** + * Temporary debugging function + */ + public function dumpUFMatch(string $s = '') { $d = \CRM_Core_DAO::executeQuery("SELECT * FROM civicrm_uf_match;"); print "\ndump---------- $s\n"; foreach ($d->fetchAll() as $row) { -- 2.25.1