function SaveActionTest::testSaveAction
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Action/SaveActionTest.php \Drupal\KernelTests\Core\Action\SaveActionTest::testSaveAction()
- 8.9.x core/tests/Drupal/KernelTests/Core/Action/SaveActionTest.php \Drupal\KernelTests\Core\Action\SaveActionTest::testSaveAction()
- 10 core/tests/Drupal/KernelTests/Core/Action/SaveActionTest.php \Drupal\KernelTests\Core\Action\SaveActionTest::testSaveAction()
@covers \Drupal\Core\Action\Plugin\Action\SaveAction::execute
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Action/ SaveActionTest.php, line 48
Class
- SaveActionTest
- @group Action
Namespace
Drupal\KernelTests\Core\ActionCode
public function testSaveAction() : void {
$entity = EntityTestMulChanged::create([
'name' => 'test',
]);
$entity->save();
$saved_time = $entity->getChangedTime();
$action = Action::create([
'id' => 'entity_save_action',
'plugin' => 'entity:save_action:entity_test_mul_changed',
]);
$action->save();
$action->execute([
$entity,
]);
$this->assertNotSame($saved_time, $entity->getChangedTime());
$this->assertSame([
'module' => [
'entity_test',
],
], $action->getDependencies());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.