You are here

public function LingotekCliServiceTest::testCheckUploadInvalidEntityId in Lingotek Translation 3.7.x

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/Cli/LingotekCliServiceTest.php \Drupal\Tests\lingotek\Unit\Cli\LingotekCliServiceTest::testCheckUploadInvalidEntityId()
  2. 4.0.x tests/src/Unit/Cli/LingotekCliServiceTest.php \Drupal\Tests\lingotek\Unit\Cli\LingotekCliServiceTest::testCheckUploadInvalidEntityId()
  3. 3.0.x tests/src/Unit/Cli/LingotekCliServiceTest.php \Drupal\Tests\lingotek\Unit\Cli\LingotekCliServiceTest::testCheckUploadInvalidEntityId()
  4. 3.1.x tests/src/Unit/Cli/LingotekCliServiceTest.php \Drupal\Tests\lingotek\Unit\Cli\LingotekCliServiceTest::testCheckUploadInvalidEntityId()
  5. 3.2.x tests/src/Unit/Cli/LingotekCliServiceTest.php \Drupal\Tests\lingotek\Unit\Cli\LingotekCliServiceTest::testCheckUploadInvalidEntityId()
  6. 3.3.x tests/src/Unit/Cli/LingotekCliServiceTest.php \Drupal\Tests\lingotek\Unit\Cli\LingotekCliServiceTest::testCheckUploadInvalidEntityId()
  7. 3.4.x tests/src/Unit/Cli/LingotekCliServiceTest.php \Drupal\Tests\lingotek\Unit\Cli\LingotekCliServiceTest::testCheckUploadInvalidEntityId()
  8. 3.5.x tests/src/Unit/Cli/LingotekCliServiceTest.php \Drupal\Tests\lingotek\Unit\Cli\LingotekCliServiceTest::testCheckUploadInvalidEntityId()
  9. 3.6.x tests/src/Unit/Cli/LingotekCliServiceTest.php \Drupal\Tests\lingotek\Unit\Cli\LingotekCliServiceTest::testCheckUploadInvalidEntityId()
  10. 3.8.x tests/src/Unit/Cli/LingotekCliServiceTest.php \Drupal\Tests\lingotek\Unit\Cli\LingotekCliServiceTest::testCheckUploadInvalidEntityId()

File

tests/src/Unit/Cli/LingotekCliServiceTest.php, line 167

Class

LingotekCliServiceTest
@coversDefaultClass \Drupal\lingotek\Cli\LingotekCliService @group lingotek @preserveGlobalState disabled

Namespace

Drupal\Tests\lingotek\Unit\Cli

Code

public function testCheckUploadInvalidEntityId() {
  $entityStorage = $this
    ->createMock(EntityStorageInterface::class);
  $this->entityTypeManager
    ->expects($this
    ->once())
    ->method('hasDefinition')
    ->with('xxxx')
    ->willReturn(TRUE);
  $this->entityTypeManager
    ->expects($this
    ->once())
    ->method('getStorage')
    ->with('xxxx')
    ->willReturn($entityStorage);
  $this->logger
    ->expects($this
    ->once())
    ->method('error');
  $upload = $this->cliService
    ->checkUpload('xxxx', 1);
  $this
    ->assertEquals($this->cliService::COMMAND_ERROR_ENTITY_NOT_FOUND, $upload);
}