You are here

public function RouterTest::testUserAccount in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/system/src/Tests/Routing/RouterTest.php \Drupal\system\Tests\Routing\RouterTest::testUserAccount()

Tests the user account on the DIC.

File

core/modules/system/src/Tests/Routing/RouterTest.php, line 237
Contains \Drupal\system\Tests\Routing\RouterTest.

Class

RouterTest
Functional class for the full integrated routing system.

Namespace

Drupal\system\Tests\Routing

Code

public function testUserAccount() {
  $account = $this
    ->drupalCreateUser();
  $this
    ->drupalLogin($account);
  $second_account = $this
    ->drupalCreateUser();
  $this
    ->drupalGet('router_test/test12/' . $second_account
    ->id());
  $this
    ->assertText($account
    ->getUsername() . ':' . $second_account
    ->getUsername());
  $this
    ->assertEqual($account
    ->id(), $this->loggedInUser
    ->id(), 'Ensure that the user was not changed.');
  $this
    ->drupalGet('router_test/test13/' . $second_account
    ->id());
  $this
    ->assertText($account
    ->getUsername() . ':' . $second_account
    ->getUsername());
  $this
    ->assertEqual($account
    ->id(), $this->loggedInUser
    ->id(), 'Ensure that the user was not changed.');
}