protected function ContentHubExportQueueControllerTest::setUp in Acquia Content Hub 8
Overrides UnitTestCase::setUp
File
- tests/
src/ Unit/ Controller/ ContentHubExportQueueControllerTest.php, line 71
Class
- ContentHubExportQueueControllerTest
- PHPUnit test for the ContentHubExportQueueController class.
Namespace
Drupal\Tests\acquia_contenthub\Unit\ControllerCode
protected function setUp() : void {
$this->container = $this
->createMock('Drupal\\Core\\DependencyInjection\\Container');
$logger_factory = $this
->createMock(LoggerChannelFactoryInterface::class);
$logger_factory
->method('get')
->with('acquia_contenthub')
->willReturn($this
->createMock(LoggerChannelInterface::class));
\Drupal::setContainer($this->container);
$this->configFactory = $this
->createMock('Drupal\\Core\\Config\\ConfigFactoryInterface');
$this->configFactory
->method('get')
->with('acquia_contenthub.entity_config')
->willReturn($this
->createMockForContentHubEntityConfig());
$this->queueFactory = $this
->getMockBuilder('Drupal\\Core\\Queue\\QueueFactory')
->disableOriginalConstructor()
->getMock();
$this->queueManager = $this
->getMockBuilder('Drupal\\Core\\Queue\\QueueWorkerManager')
->disableOriginalConstructor()
->getMock();
$this->contentHubExportQueueController = new ContentHubExportQueueController($this->queueFactory, $this->queueManager, $this->configFactory, $logger_factory);
}