(REF) Rename WorkflowMessageExample => ExampleData
authorTim Otten <totten@civicrm.org>
Fri, 10 Sep 2021 03:51:29 +0000 (20:51 -0700)
committerTim Otten <totten@civicrm.org>
Mon, 13 Sep 2021 22:33:59 +0000 (15:33 -0700)
Civi/Api4/Action/ExampleData/Get.php [moved from Civi/Api4/Action/WorkflowMessageExample/Get.php with 97% similarity]
Civi/Api4/ExampleData.php [moved from Civi/Api4/WorkflowMessageExample.php with 94% similarity]
Civi/Test/WorkflowMessageTestTrait.php
tests/phpunit/CRM/Case/WorkflowMessage/CaseActivityTest.php
tests/phpunit/api/v4/Entity/ExampleDataTest.php [moved from tests/phpunit/api/v4/Entity/WorkflowMessageExampleTest.php with 90% similarity]
tests/phpunit/api/v4/Entity/WorkflowMessageTest.php

similarity index 97%
rename from Civi/Api4/Action/WorkflowMessageExample/Get.php
rename to Civi/Api4/Action/ExampleData/Get.php
index 64cbc1f5700ea8d66b7d22840ee2300f44cf9dde..62815486758424d1ff232ecbf15788f3f8ab85fa 100644 (file)
@@ -10,7 +10,7 @@
  +--------------------------------------------------------------------+
  */
 
-namespace Civi\Api4\Action\WorkflowMessageExample;
+namespace Civi\Api4\Action\ExampleData;
 
 use Civi\Api4\Generic\BasicGetAction;
 use Civi\Api4\Generic\Result;
similarity index 94%
rename from Civi/Api4/WorkflowMessageExample.php
rename to Civi/Api4/ExampleData.php
index c672e6d91c052560d6b00103c28b337df0fddaa6..987581195b57c31e53f5cb1ec58bbc8628d776fa 100644 (file)
@@ -18,14 +18,14 @@ namespace Civi\Api4;
  * @since 5.43
  * @package Civi\Api4
  */
-class WorkflowMessageExample extends \Civi\Api4\Generic\AbstractEntity {
+class ExampleData extends \Civi\Api4\Generic\AbstractEntity {
 
   /**
    * @param bool $checkPermissions
    * @return Generic\AbstractGetAction
    */
   public static function get($checkPermissions = TRUE) {
-    return (new Action\WorkflowMessageExample\Get(__CLASS__, __FILE__))
+    return (new Action\ExampleData\Get(__CLASS__, __FILE__))
       ->setCheckPermissions($checkPermissions);
   }
 
index 395721bedeb17b1de05b8c3410655325e9ef4129..71f3fe2968a0414d64649bbd8da639be524ca31b 100644 (file)
@@ -27,7 +27,7 @@ trait WorkflowMessageTestTrait {
    * @throws \API_Exception
    */
   protected function findExamples(): \Civi\Api4\Generic\AbstractGetAction {
-    return \Civi\Api4\WorkflowMessageExample::get(0)
+    return \Civi\Api4\ExampleData::get(0)
       ->setSelect(['name', 'title', 'workflow', 'tags', 'data', 'asserts'])
       ->addWhere('workflow', '=', $this->getWorkflowName())
       ->addWhere('tags', 'CONTAINS', 'phpunit');
index 5a21f5be7c8366a22a47c210d26fb4bddec7fe65..3ca0fa32f4132d11c7d4b18b5b250a415ca10c05 100644 (file)
@@ -21,7 +21,7 @@ class CRM_Case_WorkflowMessage_CaseActivityTest extends CiviUnitTestCase {
   }
 
   public function testAdhocClassEquiv() {
-    $examples = \Civi\Api4\WorkflowMessageExample::get(0)
+    $examples = \Civi\Api4\ExampleData::get(0)
       ->setSelect(['name', 'data'])
       ->addWhere('name', 'IN', ['case_activity.adhoc_1', 'case_activity.class_1'])
       ->execute()
@@ -58,7 +58,7 @@ class CRM_Case_WorkflowMessage_CaseActivityTest extends CiviUnitTestCase {
 
     $this->assertTrue(file_exists($file), "Expect find canary file ($file)");
 
-    $get = \Civi\Api4\WorkflowMessageExample::get()
+    $get = \Civi\Api4\ExampleData::get()
       ->addWhere('name', '=', $name)
       ->execute()
       ->single();
@@ -66,7 +66,7 @@ class CRM_Case_WorkflowMessage_CaseActivityTest extends CiviUnitTestCase {
     $this->assertTrue(!isset($get['data']));
     $this->assertTrue(!isset($get['asserts']));
 
-    $get = \Civi\Api4\WorkflowMessageExample::get()
+    $get = \Civi\Api4\ExampleData::get()
       ->addWhere('name', '=', $name)
       ->addSelect('workflow', 'data')
       ->execute()
similarity index 90%
rename from tests/phpunit/api/v4/Entity/WorkflowMessageExampleTest.php
rename to tests/phpunit/api/v4/Entity/ExampleDataTest.php
index 39659455d358a1e10b038508409fafc932f7f0f4..540bf3311fddc31ebc3c484d33642fab5b9d242e 100644 (file)
@@ -24,7 +24,7 @@ use api\v4\UnitTestCase;
 /**
  * @group headless
  */
-class WorkflowMessageExampleTest extends UnitTestCase {
+class ExampleDataTest extends UnitTestCase {
 
   /**
    * Basic canary test fetching a specific example.
@@ -39,7 +39,7 @@ class WorkflowMessageExampleTest extends UnitTestCase {
 
     $this->assertTrue(file_exists($file), "Expect find canary file ($file)");
 
-    $get = \Civi\Api4\WorkflowMessageExample::get()
+    $get = \Civi\Api4\ExampleData::get()
       ->addWhere('name', '=', $name)
       ->execute()
       ->single();
@@ -47,7 +47,7 @@ class WorkflowMessageExampleTest extends UnitTestCase {
     $this->assertTrue(!isset($get['data']));
     $this->assertTrue(!isset($get['asserts']));
 
-    $get = \Civi\Api4\WorkflowMessageExample::get()
+    $get = \Civi\Api4\ExampleData::get()
       ->addWhere('name', '=', $name)
       ->addSelect('workflow', 'data')
       ->execute()
index 056dc396bb5445b4f5ceebe552d62da8a3023441..0707c13ddacc55d0719e46147e643a0b45787317 100644 (file)
@@ -36,7 +36,7 @@ class WorkflowMessageTest extends UnitTestCase {
   }
 
   public function testRenderDefaultTemplate() {
-    $ex = \Civi\Api4\WorkflowMessageExample::get(0)
+    $ex = \Civi\Api4\ExampleData::get(0)
       ->addWhere('name', '=', 'case_activity.class_1')
       ->addSelect('data', 'workflow')
       ->addChain('render', WorkflowMessage::render()
@@ -49,7 +49,7 @@ class WorkflowMessageTest extends UnitTestCase {
   }
 
   public function testRenderCustomTemplate() {
-    $ex = \Civi\Api4\WorkflowMessageExample::get(0)
+    $ex = \Civi\Api4\ExampleData::get(0)
       ->addWhere('name', '=', 'case_activity.class_1')
       ->addSelect('data')
       ->execute()
@@ -66,7 +66,7 @@ class WorkflowMessageTest extends UnitTestCase {
   }
 
   public function testRenderExamples() {
-    $examples = \Civi\Api4\WorkflowMessageExample::get(0)
+    $examples = \Civi\Api4\ExampleData::get(0)
       ->addWhere('tags', 'CONTAINS', 'phpunit')
       ->addSelect('name', 'workflow', 'data', 'asserts')
       ->execute();