function TaskAdditionAndAlterInstallerTest::testInstallTasks

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/FunctionalTests/Installer/TaskAdditionAndAlterInstallerTest.php \Drupal\FunctionalTests\Installer\TaskAdditionAndAlterInstallerTest::testInstallTasks()

Tests TaskInterface implementations.

Also confirms that if both exist the procedural implementations do not run.

Attributes

#[IgnoreDeprecations]

File

core/tests/Drupal/FunctionalTests/Installer/TaskAdditionAndAlterInstallerTest.php, line 34

Class

TaskAdditionAndAlterInstallerTest
Tests the installer calling OOP Tasks and Alters.

Namespace

Drupal\FunctionalTests\Installer

Code

public function testInstallTasks() : void {
  $this->expectUserDeprecationMessage('Code in testing_install_tasks_interface.profile is deprecated in drupal:11.5.0 and must be converted before drupal:13.0.0. Use classes instead. See https://www.drupal.org/node/3619765');
  $this->assertSame('ran', \Drupal::keyValue('testing_install_tasks_interface')->get('task', 'skipped'));
  $this->assertSame('ran', \Drupal::keyValue('testing_install_tasks_interface')->get('alter', 'skipped'));
  $this->assertNull(\Drupal::keyValue('testing_install_tasks_interface')->get('procedural_task'));
  $this->assertNull(\Drupal::keyValue('testing_install_tasks_interface')->get('procedural_alter'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.