You are here

function TMGMTUpgradeAlpha1TestCase::testUpgradePath in Translation Management Tool 7

Verifies that the data has been migrated properly

File

tests/tmgmt.upgrade.alpha1.test, line 67

Class

TMGMTUpgradeAlpha1TestCase
Upgrade tests.

Code

function testUpgradePath() {
  return;

  // Log in as a user with enough permissions.
  $translator = $this
    ->drupalCreateUser(array(
    'administer tmgmt',
  ));
  $this
    ->drupalLogin($translator);

  // Go to a job and check the review form.
  $this
    ->drupalGet('admin/tmgmt/jobs/1');

  // Make sure the #status values have been set accordingly.
  $this
    ->assertRaw(t('Accepted: @accepted, reviewed: @reviewed, translated: @translated, pending: @pending.', array(
    '@accepted' => 0,
    '@reviewed' => 0,
    '@translated' => 2,
    '@pending' => 0,
  )));

  // Extract the word count field and make sure it's correct.
  $word_count = $this
    ->xpath('//td[contains(@class, :class)]', array(
    ':class' => 'views-field-word-count-1',
  ));
  $this
    ->assertEqual(6, trim((string) reset($word_count)));
  $this
    ->clickLink(t('review'));

  // Needs review icon.
  $this
    ->assertRaw('tmgmt-ui-icon-yellow tmgmt-ui-state-translated');

  // Translated values.
  $this
    ->assertRaw('de_Test content');
  $this
    ->assertRaw('de_This is the body.');

  // Reject button.
  $this
    ->assertRaw('✗');

  // Check that accepted count has been updated correctly.
  $this
    ->drupalGet('admin/tmgmt/jobs/2');

  // Make sure the #status values have been set accordingly.
  $this
    ->assertRaw(t('Accepted: @accepted, reviewed: @reviewed, translated: @translated, pending: @pending.', array(
    '@accepted' => 2,
    '@reviewed' => 0,
    '@translated' => 0,
    '@pending' => 0,
  )));
}