+--------------------------------------------------------------------+
*/
-namespace Civi\Api4\Action\WorkflowMessageExample;
+namespace Civi\Api4\Action\ExampleData;
use Civi\Api4\Generic\BasicGetAction;
use Civi\Api4\Generic\Result;
* @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);
}
* @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');
}
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()
$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();
$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()
/**
* @group headless
*/
-class WorkflowMessageExampleTest extends UnitTestCase {
+class ExampleDataTest extends UnitTestCase {
/**
* Basic canary test fetching a specific example.
$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();
$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()
}
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()
}
public function testRenderCustomTemplate() {
- $ex = \Civi\Api4\WorkflowMessageExample::get(0)
+ $ex = \Civi\Api4\ExampleData::get(0)
->addWhere('name', '=', 'case_activity.class_1')
->addSelect('data')
->execute()
}
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();