You are here

public function CaptchaPointListBuilderTest::setUp in CAPTCHA 8

Set up.

Overrides UnitTestCase::setUp

File

tests/src/Unit/Controller/CaptchaPointListBuilderTest.php, line 24

Class

CaptchaPointListBuilderTest
Tests for CaptchaPointListBuilder.

Namespace

Drupal\Tests\captcha\Unit\Controller

Code

public function setUp() {
  $this->mockModuleHandler = $this
    ->prophesize(ModuleHandlerInterface::class);
  $this->mockModuleHandler
    ->invokeAll(Argument::any(), Argument::any())
    ->willReturn([]);
  $this->mockModuleHandler
    ->alter(Argument::any(), Argument::any(), Argument::any())
    ->willReturn([]);
  $this->mockContainer = $this
    ->prophesize(ContainerInterface::class);
  $this->mockContainer
    ->get('string_translation')
    ->willReturn($this
    ->getStringTranslationStub());
  $this->mockContainer
    ->get('module_handler')
    ->willReturn($this->mockModuleHandler
    ->reveal());
  $this->mockEntityType = $this
    ->prophesize(EntityTypeInterface::class);
  $this->mockEntityStorage = $this
    ->prophesize(EntityStorageInterface::class);
  $this->listBuilder = new CaptchaPointListBuilder($this->mockEntityType
    ->reveal(), $this->mockEntityStorage
    ->reveal());
  \Drupal::setContainer($this->mockContainer
    ->reveal());
}