You are here

function TMGMTHelperTestCase::testTMGTJobMatchItem in Translation Management Tool 7

Tests tmgmt_job_match_item()

See also

tmgmt_job_match_item

File

tests/tmgmt.helper.test, line 26

Class

TMGMTHelperTestCase
Test the helper functions in tmgmt.module.

Code

function testTMGTJobMatchItem() {
  $this
    ->loginAsAdmin();
  $this
    ->setEnvironment('fr');
  $this
    ->setEnvironment('es');

  // Add a job from en to fr and en to sp.
  $job_en_fr = $this
    ->createJob('en', 'fr');
  $job_en_sp = $this
    ->createJob('en', 'es');

  // Add a job which has existing source-target combinations.
  $this
    ->assertEqual($job_en_fr->tjid, tmgmt_job_match_item('en', 'fr')->tjid);
  $this
    ->assertEqual($job_en_sp->tjid, tmgmt_job_match_item('en', 'es')->tjid);

  // Add a job which has no existing source-target combination.
  $this
    ->assertTrue(tmgmt_job_match_item('fr', 'es'));
}