diff options
Diffstat (limited to 'modules/simpletest/tests/upgrade')
-rw-r--r-- | modules/simpletest/tests/upgrade/upgrade.poll.test | 14 | ||||
-rw-r--r-- | modules/simpletest/tests/upgrade/upgrade.test | 13 |
2 files changed, 12 insertions, 15 deletions
diff --git a/modules/simpletest/tests/upgrade/upgrade.poll.test b/modules/simpletest/tests/upgrade/upgrade.poll.test index 24245e4e4..b1df28283 100644 --- a/modules/simpletest/tests/upgrade/upgrade.poll.test +++ b/modules/simpletest/tests/upgrade/upgrade.poll.test @@ -31,7 +31,7 @@ class PollUpgradePathTestCase extends UpgradePathTestCase { * Test a successful upgrade. */ public function testPollUpgrade() { - $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); + $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); // Check modules page for poll $this->drupalGet('admin/modules'); @@ -43,24 +43,22 @@ class PollUpgradePathTestCase extends UpgradePathTestCase { $nbchoices = ($i % 4) + 2; for ($c = 0; $c < $nbchoices; $c++) { - $this->assertText("Choice $c for poll $i", 'Choice text is displayed correctly on poll view'); + $this->assertText("Choice $c for poll $i", t('Choice text is displayed correctly on poll view')); } // Now check that the votes are correct $this->clickLink(t('Results')); for ($c = 0; $c < $nbchoices; $c++) { - $this->assertText("Choice $c for poll $i", 'Choice text is displayed correctly on result view'); + $this->assertText("Choice $c for poll $i", t('Choice text is displayed correctly on result view')); } - $nbvotes = floor(($i % 4) + 5); + $nbvotes = floor (($i % 4) + 5); $elements = $this->xpath("//div[@class='percent']"); for ($c = 0; $c < $nbchoices; $c++) { $votes = floor($nbvotes / $nbchoices); - if (($nbvotes % $nbchoices) > $c) { - $votes++; - } - $this->assertTrue(preg_match("/$votes vote/", $elements[$c]), 'The number of votes is displayed correctly: expected ' . $votes . ', got ' . $elements[$c]); + if (($nbvotes % $nbchoices) > $c) $votes++; + $this->assertTrue(preg_match("/$votes vote/", $elements[$c]), t('The number of votes is displayed correctly: expected ' . $votes . ', got ' . $elements[$c])); } } } diff --git a/modules/simpletest/tests/upgrade/upgrade.test b/modules/simpletest/tests/upgrade/upgrade.test index 1d134f278..d0a3bc885 100644 --- a/modules/simpletest/tests/upgrade/upgrade.test +++ b/modules/simpletest/tests/upgrade/upgrade.test @@ -197,8 +197,7 @@ abstract class UpgradePathTestCase extends DrupalWebTestCase { } // Since cache_bootstrap won't exist in a Drupal 6 site, ignore the // exception if the above fails. - catch (Exception $e) { - } + catch (Exception $e) {} } /** @@ -258,7 +257,7 @@ abstract class UpgradePathTestCase extends DrupalWebTestCase { // Check if there still are pending updates. $this->drupalGet($update_url, array('external' => TRUE)); $this->drupalPost(NULL, array(), t('Continue')); - if (!$this->assertText(t('No pending updates.'), 'No pending updates at the end of the update process.')) { + if (!$this->assertText(t('No pending updates.'), t('No pending updates at the end of the update process.'))) { return FALSE; } @@ -341,14 +340,14 @@ class BasicUpgradePath extends UpgradePathTestCase { // Destroy a table that the upgrade process needs. db_drop_table('access'); // Assert that the upgrade fails. - $this->assertFalse($this->performUpgrade(FALSE), 'A failed upgrade should return messages.'); + $this->assertFalse($this->performUpgrade(FALSE), t('A failed upgrade should return messages.')); } /** * Test a successful upgrade. */ public function testBasicUpgrade() { - $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); + $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); // Hit the frontpage. $this->drupalGet(''); @@ -357,7 +356,7 @@ class BasicUpgradePath extends UpgradePathTestCase { // Verify that we are still logged in. $this->drupalGet('user'); $this->clickLink(t('Edit')); - $this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), 'We are still logged in as admin at the end of the upgrade.'); + $this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), t('We are still logged in as admin at the end of the upgrade.')); // Logout and verify that we can login back in with our initial password. $this->drupalLogout(); @@ -368,7 +367,7 @@ class BasicUpgradePath extends UpgradePathTestCase { )); // Test that the site name is correctly displayed. - $this->assertText('Drupal 6', 'The site name is correctly displayed.'); + $this->assertText('Drupal 6', t('The site name is correctly displayed.')); // Verify that the main admin sections are available. $this->drupalGet('admin'); |