public function UserTranslationUITest::testTranslatedUserDeletion in Drupal 9
Same name and namespace in other branches
- 8 core/modules/user/tests/src/Functional/UserTranslationUITest.php \Drupal\Tests\user\Functional\UserTranslationUITest::testTranslatedUserDeletion()
- 10 core/modules/user/tests/src/Functional/UserTranslationUITest.php \Drupal\Tests\user\Functional\UserTranslationUITest::testTranslatedUserDeletion()
Tests translated user deletion.
File
- core/
modules/ user/ tests/ src/ Functional/ UserTranslationUITest.php, line 97
Class
- UserTranslationUITest
- Tests the User Translation UI.
Namespace
Drupal\Tests\user\FunctionalCode
public function testTranslatedUserDeletion() {
$this
->drupalLogin($this->administrator);
$entity_id = $this
->createEntity($this
->getNewEntityValues('en'), 'en');
$entity = $this->container
->get('entity_type.manager')
->getStorage($this->entityTypeId)
->load($entity_id);
$translated_entity = $entity
->addTranslation('fr');
$translated_entity
->save();
$url = $entity
->toUrl('edit-form', [
'language' => $this->container
->get('language_manager')
->getLanguage('en'),
]);
$this
->drupalGet($url);
$this
->submitForm([], 'Cancel account');
$this
->assertSession()
->statusCodeEquals(200);
}