Use "automation" instead of "workflow"

[MAILPOET-4793]
This commit is contained in:
Jan Jakes
2022-11-10 10:24:31 +03:00
committed by David Remer
parent d199c3768a
commit 9d55d3f134
210 changed files with 3677 additions and 3659 deletions

View File

@@ -0,0 +1,30 @@
<?php declare(strict_types = 1);
namespace MailPoet\Automation\Engine\Validation\AutomationRules;
require_once __DIR__ . '/AutomationRuleTest.php';
use MailPoet\Automation\Engine\Data\Automation;
use MailPoet\Automation\Engine\Exceptions\UnexpectedValueException;
use MailPoet\Automation\Engine\Validation\AutomationGraph\AutomationWalker;
class ConsistentStepMapRuleTest extends AutomationRuleTest {
public function testItDetectsWrongKeyValuePair(): void {
$automation = $this->make(Automation::class, ['getSteps' => [
'root' => $this->createStep('a'),
]]);
$this->expectException(UnexpectedValueException::class);
$this->expectExceptionMessage("Invalid automation structure: Step with ID 'a' stored under a mismatched index 'root'.");
(new AutomationWalker())->walk($automation, [new ConsistentStepMapRule()]);
}
public function testItPassesWithCorrectKeyValuePair(): void {
$automation = $this->make(Automation::class, ['getSteps' => [
'root' => $this->createStep('root'),
]]);
(new AutomationWalker())->walk($automation, [new ConsistentStepMapRule()]);
// no exception thrown
}
}