public function ImportEntityManagerTest::setUp in Acquia Content Hub 8
Overrides UnitTestCase::setUp
File
- tests/
src/ Unit/ ImportEntityManagerTest.php, line 76
Class
- ImportEntityManagerTest
- PHPUnit test for the ImportEntityManager class.
Namespace
Drupal\Tests\acquia_contenthub\UnitCode
public function setUp() : void {
parent::setUp();
$this->database = $this
->getMockBuilder('Drupal\\Core\\Database\\Connection')
->disableOriginalConstructor()
->getMock();
$this->languageManager = $this
->createMock('Drupal\\Core\\Language\\LanguageManagerInterface');
$this->loggerFactory = $this
->getMockBuilder('Drupal\\Core\\Logger\\LoggerChannelFactoryInterface')
->disableOriginalConstructor()
->getMock();
$this->serializer = $this
->createMock('\\Symfony\\Component\\Serializer\\SerializerInterface');
$this->entityRepository = $this
->createMock('\\Drupal\\Core\\Entity\\EntityRepositoryInterface');
$this->clientManager = $this
->createMock('\\Drupal\\acquia_contenthub\\Client\\ClientManagerInterface');
$this->contentHubEntitiesTracking = $this
->getMockBuilder('Drupal\\acquia_contenthub\\ContentHubEntitiesTracking')
->disableOriginalConstructor()
->getMock();
$this->diffEntityComparison = $this
->getMockBuilder('Drupal\\diff\\DiffEntityComparison')
->disableOriginalConstructor()
->getMock();
$this->entityManager = $this
->getMockBuilder('Drupal\\acquia_contenthub\\EntityManager')
->disableOriginalConstructor()
->getMock();
$this->translation_manager = $this
->getMockBuilder('Drupal\\Core\\StringTranslation\\TranslationInterface')
->disableOriginalConstructor()
->getMock();
$this->importQueue = $this
->createMock('\\Drupal\\Core\\Queue\\QueueInterface');
$this->queueFactory = $this
->getMockBuilder('Drupal\\Core\\Queue\\QueueFactory')
->disableOriginalConstructor()
->setMethods([
'get',
])
->getMock();
$this->queueFactory
->method('get')
->with('acquia_contenthub_import_queue')
->willReturn($this->importQueue);
$this->importEntityManager = new ImportEntityManager($this->database, $this->loggerFactory, $this->serializer, $this->entityRepository, $this->clientManager, $this->contentHubEntitiesTracking, $this->diffEntityComparison, $this->entityManager, $this->translation_manager, $this->queueFactory, $this->languageManager);
}