You are here

public function ProcessorPluginManagerTest::setUp in Facets 8

Overrides UnitTestCase::setUp

File

tests/src/Unit/Processor/ProcessorPluginManagerTest.php, line 67

Class

ProcessorPluginManagerTest
Unit test for Processor plugin manager.

Namespace

Drupal\Tests\facets\Unit\Processor

Code

public function setUp() {
  $this->discovery = $this
    ->createMock(DiscoveryInterface::class);
  $this->factory = $this
    ->getMockBuilder(DefaultFactory::class)
    ->disableOriginalConstructor()
    ->getMock();
  $this->moduleHandler = $this
    ->createMock(ModuleHandlerInterface::class);
  $this->cache = $this
    ->createMock(CacheBackendInterface::class);
  $this->translator = $this
    ->createMock(TranslationInterface::class);
  $namespaces = new ArrayObject();
  $this->sut = new ProcessorPluginManager($namespaces, $this->cache, $this->moduleHandler, $this->translator);
  $discovery_property = new \ReflectionProperty($this->sut, 'discovery');
  $discovery_property
    ->setAccessible(TRUE);
  $discovery_property
    ->setValue($this->sut, $this->discovery);
  $factory_property = new \ReflectionProperty($this->sut, 'factory');
  $factory_property
    ->setAccessible(TRUE);
  $factory_property
    ->setValue($this->sut, $this->factory);
}