From b5f9f2dd1422b77d38380bb825f48eab782c099e Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 4 Mar 2021 01:37:44 -0800 Subject: [PATCH] (REF) RestTest - Split into a base-class and concrete-class --- .../Extern/{RestTest.php => BaseRestTest.php} | 7 ++--- tests/phpunit/E2E/Extern/LegacyRestTest.php | 31 +++++++++++++++++++ 2 files changed, 33 insertions(+), 5 deletions(-) rename tests/phpunit/E2E/Extern/{RestTest.php => BaseRestTest.php} (98%) create mode 100644 tests/phpunit/E2E/Extern/LegacyRestTest.php diff --git a/tests/phpunit/E2E/Extern/RestTest.php b/tests/phpunit/E2E/Extern/BaseRestTest.php similarity index 98% rename from tests/phpunit/E2E/Extern/RestTest.php rename to tests/phpunit/E2E/Extern/BaseRestTest.php index ed3aed7019..626f89598e 100644 --- a/tests/phpunit/E2E/Extern/RestTest.php +++ b/tests/phpunit/E2E/Extern/BaseRestTest.php @@ -14,7 +14,7 @@ * * @group e2e */ -class E2E_Extern_RestTest extends CiviEndToEndTestCase { +abstract class E2E_Extern_BaseRestTest extends CiviEndToEndTestCase { protected $url; protected static $api_key; protected $session_id; @@ -46,10 +46,7 @@ class E2E_Extern_RestTest extends CiviEndToEndTestCase { $this->old_api_keys = []; } - protected function getRestUrl() { - return CRM_Core_Resources::singleton() - ->getUrl('civicrm', 'extern/rest.php'); - } + abstract protected function getRestUrl(); protected function tearDown(): void { if (!empty($this->old_api_keys)) { diff --git a/tests/phpunit/E2E/Extern/LegacyRestTest.php b/tests/phpunit/E2E/Extern/LegacyRestTest.php new file mode 100644 index 0000000000..e6c72a092a --- /dev/null +++ b/tests/phpunit/E2E/Extern/LegacyRestTest.php @@ -0,0 +1,31 @@ +markTestSkipped('Legacy extern/rest.php does not apply to Drupal 8+'); + } + parent::setUp(); + } + + protected function getRestUrl() { + return CRM_Core_Resources::singleton() + ->getUrl('civicrm', 'extern/rest.php'); + } + +} -- 2.25.1