function UserRegistrationResourceTest::setUp

Same name in other branches
  1. 9 core/modules/user/tests/src/Unit/UserRegistrationResourceTest.php \Drupal\Tests\user\Unit\UserRegistrationResourceTest::setUp()
  2. 8.9.x core/modules/user/tests/src/Unit/UserRegistrationResourceTest.php \Drupal\Tests\user\Unit\UserRegistrationResourceTest::setUp()
  3. 10 core/modules/user/tests/src/Unit/UserRegistrationResourceTest.php \Drupal\Tests\user\Unit\UserRegistrationResourceTest::setUp()

Overrides UnitTestCase::setUp

File

core/modules/user/tests/src/Unit/UserRegistrationResourceTest.php, line 73

Class

UserRegistrationResourceTest
Tests User Registration REST resource.

Namespace

Drupal\Tests\user\Unit

Code

protected function setUp() : void {
    parent::setUp();
    $this->logger = $this->prophesize(LoggerInterface::class)
        ->reveal();
    $this->userSettings = $this->prophesize(ImmutableConfig::class);
    $this->currentUser = $this->prophesize(AccountInterface::class);
    $this->passwordGenerator = $this->prophesize(PasswordGeneratorInterface::class)
        ->reveal();
    $this->testClass = new UserRegistrationResource([], 'plugin_id', '', [], $this->logger, $this->userSettings
        ->reveal(), $this->currentUser
        ->reveal(), $this->passwordGenerator);
    $this->reflection = new \ReflectionClass($this->testClass);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.