GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /nginx/html/Student/JimMartinson/Lab12/drupal/core/modules/user/src/Tests/ |
Upload File : |
<?php namespace Drupal\user\Tests; use Drupal\content_translation\Tests\ContentTranslationUITestBase; /** * Tests the User Translation UI. * * @group user */ class UserTranslationUITest extends ContentTranslationUITestBase { /** * The user name of the test user. * * @var string */ protected $name; /** * Modules to enable. * * @var array */ public static $modules = ['language', 'content_translation', 'user', 'views']; protected function setUp() { $this->entityTypeId = 'user'; $this->testLanguageSelector = FALSE; $this->name = $this->randomMachineName(); parent::setUp(); \Drupal::entityManager()->getStorage('user')->resetCache(); } /** * {@inheritdoc} */ protected function getTranslatorPermissions() { return array_merge(parent::getTranslatorPermissions(), ['administer users']); } /** * {@inheritdoc} */ protected function getNewEntityValues($langcode) { // User name is not translatable hence we use a fixed value. return ['name' => $this->name] + parent::getNewEntityValues($langcode); } /** * {@inheritdoc} */ protected function doTestTranslationEdit() { $storage = $this->container->get('entity_type.manager') ->getStorage($this->entityTypeId); $storage->resetCache([$this->entityId]); $entity = $storage->load($this->entityId); $languages = $this->container->get('language_manager')->getLanguages(); foreach ($this->langcodes as $langcode) { // We only want to test the title for non-english translations. if ($langcode != 'en') { $options = ['language' => $languages[$langcode]]; $url = $entity->urlInfo('edit-form', $options); $this->drupalGet($url); $title = t('@title [%language translation]', [ '@title' => $entity->getTranslation($langcode)->label(), '%language' => $languages[$langcode]->getName(), ]); $this->assertRaw($title); } } } }