コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function getAccountName()
 {
     return $this->subject->getAccountName();
 }
コード例 #2
0
 /**
  * Asserts that the currently logged-in user can not masquerade as a given target user.
  *
  * @param \Drupal\user\UserInterface $target_account
  *   The user to masquerade to.
  */
 protected function assertCanNotMasqueradeAs($target_account)
 {
     $edit = array('masquerade_as' => $target_account->getAccountName());
     $this->drupalPostForm('masquerade', $edit, t('Switch'));
     $this->assertRaw(t('You are not allowed to masquerade as %name.', array('%name' => $target_account->getDisplayName())));
     $this->assertNoText(t('Unmasquerade'));
 }