public function DigestActionsTest::testActionsNode in Message Digest 8
Test actions.
@dataProvider providerTestActionsNode
File
- message_digest_ui/
tests/ src/ Kernel/ DigestActionsTest.php, line 89
Class
- DigestActionsTest
- Test message digest actions.
Namespace
Drupal\Tests\message_digest_ui\KernelCode
public function testActionsNode($action_id, $interval_plugin, $flag_id) {
/** @var \Drupal\system\Entity\Action $action */
$action = $this->actionStorage
->load($action_id);
$plugin = $action
->getPlugin();
$flag = $this->flagService
->getFlagById($flag_id);
$entity = $this
->getTestEntity($flag);
// Flag the entity on behalf of user 2.
$this->flagService
->flag($flag, $entity, $this->users[2]);
// Trigger plugin.
$plugin
->execute($entity);
$flagging = $this->flagService
->getFlagging($flag, $entity, $this->users[2]);
$this
->assertEquals($interval_plugin, $flagging->message_digest->value);
}