You are here

public function ImportEntityManagerTest::testImportWithoutQueue in Acquia Content Hub 8

Ensure if configuration is correct entity will be imported immediately.

@covers ::import @dataProvider provideEntityUuid

File

tests/src/Unit/ImportEntityManagerTest.php, line 1074

Class

ImportEntityManagerTest
PHPUnit test for the ImportEntityManager class.

Namespace

Drupal\Tests\acquia_contenthub\Unit

Code

public function testImportWithoutQueue($uuid = '') {
  $importEntityManager = $this
    ->getMockBuilder(ImportEntityManager::class)
    ->disableOriginalConstructor()
    ->setMethods([
    'addEntityToImportQueue',
    'importRemoteEntity',
  ])
    ->getMock();
  $this
    ->buildConfigContainer([
    'acquia_contenthub.entity_config' => [
      'import_with_queue' => FALSE,
    ],
  ]);
  $importEntityManager
    ->expects($this
    ->once())
    ->method('importRemoteEntity')
    ->with($uuid);
  $importEntityManager
    ->expects($this
    ->never())
    ->method('addEntityToImportQueue');
  $importEntityManager
    ->import($uuid);
}