Skip to content
Snippets Groups Projects
Commit 6c46d1c3 authored by Drew Webber's avatar Drew Webber
Browse files

Issue #3265522 by mcdruid: Skip Upgrade tests for PostgreSQL

parent 98d77287
Branches
Tags
1 merge request!7330Issue #3306390 by poker10, catch, Fabianx, pwolanin, rvtraveller: [D7]...
Showing
with 64 additions and 0 deletions
......@@ -27,6 +27,9 @@ class CommentUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade.
*/
public function testCommentUpgrade() {
if ($this->skipUpgradeTest) {
return;
}
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
}
}
......@@ -28,6 +28,9 @@ class FilterFormatUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade.
*/
function testFilterFormatUpgrade() {
if ($this->skipUpgradeTest) {
return;
}
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
$format = filter_format_load('1');
......
......@@ -27,6 +27,9 @@ class ForumUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade (no negotiation).
*/
public function testForumUpgrade() {
if ($this->skipUpgradeTest) {
return;
}
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Work around http://drupal.org/node/931512
......
......@@ -27,6 +27,9 @@ class LocaleUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade (no negotiation).
*/
public function testLocaleUpgrade() {
if ($this->skipUpgradeTest) {
return;
}
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// The home page should be in French.
......@@ -43,6 +46,9 @@ class LocaleUpgradePathTestCase extends UpgradePathTestCase {
* Test an upgrade with path-based negotiation.
*/
public function testLocaleUpgradePathDefault() {
if ($this->skipUpgradeTest) {
return;
}
// LANGUAGE_NEGOTIATION_PATH_DEFAULT.
$this->variable_set('language_negotiation', 1);
......@@ -66,6 +72,9 @@ class LocaleUpgradePathTestCase extends UpgradePathTestCase {
* Test an upgrade with path-based (with fallback) negotiation.
*/
public function testLocaleUpgradePathFallback() {
if ($this->skipUpgradeTest) {
return;
}
// LANGUAGE_NEGOTIATION_PATH.
$this->variable_set('language_negotiation', 2);
......@@ -92,6 +101,9 @@ class LocaleUpgradePathTestCase extends UpgradePathTestCase {
* Test an upgrade with domain-based negotiation.
*/
public function testLocaleUpgradeDomain() {
if ($this->skipUpgradeTest) {
return;
}
// LANGUAGE_NEGOTIATION_DOMAIN.
$this->variable_set('language_negotiation', 3);
......
......@@ -27,6 +27,9 @@ class MenuUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade.
*/
public function testMenuUpgrade() {
if ($this->skipUpgradeTest) {
return;
}
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Test the migration of "Default menu for content" setting to individual
......
......@@ -26,6 +26,9 @@ class NodeBodyUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade.
*/
public function testNodeBodyUpgrade() {
if ($this->skipUpgradeTest) {
return;
}
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
$instance = field_info_instance('node', 'body', 'story');
......@@ -77,6 +80,9 @@ class DisabledNodeTypeTestCase extends UpgradePathTestCase {
* Tests a successful upgrade.
*/
public function testDisabledNodeTypeUpgrade() {
if ($this->skipUpgradeTest) {
return;
}
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
$this->assertTrue(field_info_instance('comment', 'comment_body', 'comment_node_broken'), 'Comment body field instance was created for comments attached to the disabled broken node type');
}
......@@ -114,6 +120,9 @@ class PollUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade.
*/
public function testPollUpgrade() {
if ($this->skipUpgradeTest) {
return;
}
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Check modules page for poll
......
......@@ -32,6 +32,9 @@ class PollUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade.
*/
public function testPollUpgrade() {
if ($this->skipUpgradeTest) {
return;
}
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Check modules page for poll
......
......@@ -46,6 +46,9 @@ class UpgradePathTaxonomyTestCase extends UpgradePathTestCase {
* Basic tests for the taxonomy upgrade.
*/
public function testTaxonomyUpgrade() {
if ($this->skipUpgradeTest) {
return;
}
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Visit the front page to assert for PHP warning and errors.
......
......@@ -37,6 +37,11 @@ abstract class UpgradePathTestCase extends DrupalWebTestCase {
*/
var $pendingUpdates = TRUE;
/**
* Flag to indicate whether to skip upgrade tests.
*/
var $skipUpgradeTest = FALSE;
/**
* Constructs an UpgradePathTestCase object.
*
......@@ -46,6 +51,8 @@ abstract class UpgradePathTestCase extends DrupalWebTestCase {
*/
function __construct($test_id = NULL) {
parent::__construct($test_id);
$connection_info = Database::getConnectionInfo();
$this->skipUpgradeTest = (bool) ($connection_info['default']['driver'] == 'pgsql');
$this->zlibInstalled = function_exists('gzopen');
}
......
......@@ -28,6 +28,9 @@ class TranslatableUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade (no negotiation).
*/
public function testTranslatableUpgrade() {
if ($this->skipUpgradeTest) {
return;
}
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// The D6 database contains the english node "First translatable page" with
......
......@@ -29,6 +29,9 @@ class UpgradePathTriggerTestCase extends UpgradePathTestCase {
* Basic tests for the trigger upgrade.
*/
public function testTaxonomyUpgrade() {
if ($this->skipUpgradeTest) {
return;
}
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
$this->drupalGet('admin/structure/trigger/node');
$this->assertRaw('<td>'. t('Make post sticky') .'</td>');
......
......@@ -29,6 +29,9 @@ class UploadUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade.
*/
public function testUploadUpgrade() {
if ($this->skipUpgradeTest) {
return;
}
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'node');
......
......@@ -24,6 +24,9 @@ class UserUpgradePathPasswordTokenTestCase extends UpgradePathTestCase {
* Test a successful upgrade.
*/
public function testUserUpgrade() {
if ($this->skipUpgradeTest) {
return;
}
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
$this->assertEqual(variable_get('user_mail_register_no_approval_required_body'), ', [user:name], [site:name], [site:url], [site:url-brief], [user:mail], [date:medium], [site:login-url], [user:edit-url], [user:one-time-login-url].', 'Existing email templates have been modified (password token involved).');
// Check that a non-md5 hash was untouched.
......@@ -57,6 +60,9 @@ class UserUpgradePathNoPasswordTokenTestCase extends UpgradePathTestCase {
* Test a successful upgrade.
*/
public function testUserUpgrade() {
if ($this->skipUpgradeTest) {
return;
}
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
$this->assertEqual(variable_get('user_mail_register_no_approval_required_body'), '[user:name], [site:name], [site:url], [site:url-brief], [user:mail], [date:medium], [site:login-url], [user:edit-url], [user:one-time-login-url].', 'Existing email templates have been modified (password token not involved).');
}
......@@ -87,6 +93,9 @@ class UserUpgradePathDuplicatedPermissionTestCase extends UpgradePathTestCase {
* Test a successful upgrade.
*/
public function testUserUpgrade() {
if ($this->skipUpgradeTest) {
return;
}
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment