You are here

public function GroupPermissionHashGeneratorTest::setUp in Group 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Unit/GroupPermissionHashGeneratorTest.php \Drupal\Tests\group\Unit\GroupPermissionHashGeneratorTest::setUp()

Overrides UnitTestCase::setUp

File

tests/src/Unit/GroupPermissionHashGeneratorTest.php, line 58

Class

GroupPermissionHashGeneratorTest
Tests the group permission hash generator service.

Namespace

Drupal\Tests\group\Unit

Code

public function setUp() {
  parent::setUp();
  new Settings([
    'hash_salt' => 'SALT',
  ]);
  $private_key = $this
    ->prophesize(PrivateKey::class);
  $private_key
    ->get()
    ->willReturn('');
  $this->static = $this
    ->prophesize(CacheBackendInterface::class);
  $this->permissionCalculator = $this
    ->prophesize(ChainGroupPermissionCalculatorInterface::class);
  $this->hashGenerator = new GroupPermissionsHashGenerator($private_key
    ->reveal(), $this->static
    ->reveal(), $this->permissionCalculator
    ->reveal());
  $account = $this
    ->prophesize(AccountInterface::class);
  $account
    ->id()
    ->willReturn(24101986);
  $this->account = $account
    ->reveal();
}