You are here

public function JobsTest::testBucketJobNameAlter in TMGMT Translator Smartling 8.4

Same name and namespace in other branches
  1. 8.3 tests/src/Functional/JobsTest.php \Drupal\Tests\tmgmt_smartling\Functional\JobsTest::testBucketJobNameAlter()

Test alter job name hook.

File

tests/src/Functional/JobsTest.php, line 101

Class

JobsTest
Jobs tests.

Namespace

Drupal\Tests\tmgmt_smartling\Functional

Code

public function testBucketJobNameAlter() {
  $name = 'Test bucket job name';
  $bucket_job_manager = Drupal::service('tmgmt_smartling.bucket_job_manager');
  $reflection = new \ReflectionClass(get_class($bucket_job_manager));
  $method = $reflection
    ->getMethod('getName');
  $method
    ->setAccessible(true);
  $job_bucket_name = $method
    ->invokeArgs($bucket_job_manager, []);
  $this
    ->assertNotEqual($job_bucket_name, $name);
  \Drupal::service('module_installer')
    ->install([
    'tmgmt_smartling_test_alter_filename',
  ]);
  $job_bucket_name = $method
    ->invokeArgs($bucket_job_manager, []);
  $this
    ->assertEqual($job_bucket_name, $name);
}