From: Tim Otten Date: Thu, 4 Mar 2021 09:37:44 +0000 (-0800) Subject: (REF) RestTest - Split into a base-class and concrete-class X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b5f9f2dd1422b77d38380bb825f48eab782c099e;p=civicrm-core.git (REF) RestTest - Split into a base-class and concrete-class --- 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'); + } + +}