doTestIdenticalUser example

$this->installSchema('system', 'sequences');
    $this->installEntitySchema('user');

    $this->anonymous = User::create(['uid' => 0]);
    $this->authenticated = User::create(['uid' => 1]);
  }

  /** * Tests the dual user condition. */
  public function testConditions() {
    $this->doTestIdenticalUser();
    $this->doTestDifferentUser();
  }

  /** * Tests with both contexts mapped to the same user. */
  protected function doTestIdenticalUser() {
    /** @var \Drupal\Core\Condition\ConditionPluginBase $condition */
    $condition = \Drupal::service('plugin.manager.condition')
      ->createInstance('condition_test_dual_user')
      // Map the anonymous user to both contexts.
Home | Imprint | This part of the site doesn't use cookies.