You are here

private function FileUploadSecureValidatorTest::getTranslationManagerMock in File Upload Secure Validator 8

Utility function for getting a TranslationManager service.

2 calls to FileUploadSecureValidatorTest::getTranslationManagerMock()
FileUploadSecureValidatorTest::fileUploadScenariosProvider in tests/src/Unit/FileUploadSecureValidatorTest.php
Scenario related data are created in this function.
FileUploadSecureValidatorTest::testFileUploadSecureValidatorValidate in tests/src/Unit/FileUploadSecureValidatorTest.php
Tests the file upload validate function of the provided service.

File

tests/src/Unit/FileUploadSecureValidatorTest.php, line 125

Class

FileUploadSecureValidatorTest
A class for unit testing the file_upload_secure_validator service.

Namespace

Drupal\Tests\file_upload_secure_validator\Unit

Code

private function getTranslationManagerMock() {
  $translationManager = $this
    ->getMockBuilder('Drupal\\Core\\StringTranslation\\TranslationManager')
    ->disableOriginalConstructor()
    ->getMock();
  $translationManager
    ->expects($this
    ->any())
    ->method('translate')
    ->will($this
    ->returnArgument(0));
  return $translationManager;
}