You are here

protected function UncacheableEntityPermissionProviderTest::setUp in Entity API 8

Overrides UnitTestCase::setUp

File

tests/src/Unit/UncacheableEntityPermissionProviderTest.php, line 29

Class

UncacheableEntityPermissionProviderTest
@coversDefaultClass \Drupal\entity\UncacheableEntityPermissionProvider @group entity

Namespace

Drupal\Tests\entity\Unit

Code

protected function setUp() {
  parent::setUp();
  $entity_type_bundle_info = $this
    ->prophesize(EntityTypeBundleInfoInterface::class);
  $entity_type_bundle_info
    ->getBundleInfo('white_entity')
    ->willReturn([
    'first' => [
      'label' => 'First',
    ],
    'second' => [
      'label' => 'Second',
    ],
  ]);
  $entity_type_bundle_info
    ->getBundleInfo('black_entity')
    ->willReturn([
    'third' => [
      'label' => 'Third',
    ],
  ]);
  $entity_type_bundle_info
    ->getBundleInfo('pink_entity')
    ->willReturn([
    'third' => [
      'label' => 'Third',
    ],
  ]);
  $this->permissionProvider = new UncacheableEntityPermissionProvider($entity_type_bundle_info
    ->reveal());
  $this->permissionProvider
    ->setStringTranslation($this
    ->getStringTranslationStub());
}