function UserTranslationUITest::testTranslatedUserDeletion
Same name in other branches
- 9 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()
- 11.x core/modules/user/tests/src/Functional/UserTranslationUITest.php \Drupal\Tests\user\Functional\UserTranslationUITest::testTranslatedUserDeletion()
Test translated user deletion.
File
-
core/
modules/ user/ tests/ src/ Functional/ UserTranslationUITest.php, line 91
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->drupalPostForm($url, [], t('Cancel account'));
$this->assertSession()
->statusCodeEquals(200);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.