public function PathAliasDeleteByPathTest::testActionExecution in Rules 8.3
Tests the action execution.
@covers ::execute
File
- tests/
src/ Unit/ Integration/ RulesAction/ PathAliasDeleteByPathTest.php, line 58
Class
- PathAliasDeleteByPathTest
- @coversDefaultClass \Drupal\rules\Plugin\RulesAction\PathAliasDeleteByPath @group RulesAction
Namespace
Drupal\Tests\rules\Unit\Integration\RulesActionCode
public function testActionExecution() {
$path = '/node/1';
$this->action
->setContextValue('path', $path);
$path_alias = $this
->prophesizeEntity(PathAliasInterface::class);
$this->aliasStorage
->delete([
$path_alias
->reveal(),
])
->shouldBeCalledTimes(1);
$this->aliasStorage
->loadByProperties([
'path' => $path,
])
->willReturn([
$path_alias
->reveal(),
])
->shouldBeCalledTimes(1);
$this->action
->execute();
}