From e9dbf621e09294bc85567d1dd7f1d87213190d00 Mon Sep 17 00:00:00 2001 From: Phil Tyler Date: Thu, 5 Dec 2024 16:58:03 -0800 Subject: [PATCH] rm CI and tests --- .../.github/PULL_REQUEST_TEMPLATE.md | 17 - modules/pantheon/tag1_d7es/.gitlab-ci.yml | 31 - .../pantheon/tag1_d7es/tests/tag1_d7es.test | 158 ----- .../tag1_d7es/tests/tag1_d7es_admin.test | 123 ---- .../tests/tag1_d7es_admin_ctools.test | 40 -- .../tag1_d7es/tests/tag1_d7es_ctools.test | 29 - .../tag1_d7es/tests/tag1_d7es_fetch_url.test | 53 -- .../tag1_d7es/tests/tag1_d7es_mail.test | 97 ---- .../tag1_d7es/tests/tag1_d7es_test.1_0.xml | 34 -- .../tag1_d7es/tests/tag1_d7es_test.1_1.xml | 51 -- .../tag1_d7es/tests/tag1_d7es_test.1_2.xml | 52 -- .../tag1_d7es/tests/tag1_d7es_test.1_3.xml | 51 -- .../tag1_d7es/tests/tag1_d7es_test.2_0.xml | 34 -- .../tag1_d7es/tests/tag1_d7es_test.2_1.xml | 52 -- .../tag1_d7es/tests/tag1_d7es_test.2_2.xml | 53 -- .../tag1_d7es/tests/tag1_d7es_test.3_0.xml | 51 -- .../tag1_d7es/tests/tag1_d7es_test.3_1.xml | 52 -- .../tag1_d7es/tests/tag1_d7es_test.4_0.xml | 68 --- .../tag1_d7es/tests/tag1_d7es_test.info | 11 - .../tag1_d7es/tests/tag1_d7es_test.module | 51 -- .../tag1_d7es/tests/tag1_d7es_update.test | 539 ------------------ 21 files changed, 1647 deletions(-) delete mode 100644 modules/pantheon/tag1_d7es/.github/PULL_REQUEST_TEMPLATE.md delete mode 100644 modules/pantheon/tag1_d7es/.gitlab-ci.yml delete mode 100644 modules/pantheon/tag1_d7es/tests/tag1_d7es.test delete mode 100644 modules/pantheon/tag1_d7es/tests/tag1_d7es_admin.test delete mode 100644 modules/pantheon/tag1_d7es/tests/tag1_d7es_admin_ctools.test delete mode 100644 modules/pantheon/tag1_d7es/tests/tag1_d7es_ctools.test delete mode 100644 modules/pantheon/tag1_d7es/tests/tag1_d7es_fetch_url.test delete mode 100644 modules/pantheon/tag1_d7es/tests/tag1_d7es_mail.test delete mode 100644 modules/pantheon/tag1_d7es/tests/tag1_d7es_test.1_0.xml delete mode 100644 modules/pantheon/tag1_d7es/tests/tag1_d7es_test.1_1.xml delete mode 100644 modules/pantheon/tag1_d7es/tests/tag1_d7es_test.1_2.xml delete mode 100644 modules/pantheon/tag1_d7es/tests/tag1_d7es_test.1_3.xml delete mode 100644 modules/pantheon/tag1_d7es/tests/tag1_d7es_test.2_0.xml delete mode 100644 modules/pantheon/tag1_d7es/tests/tag1_d7es_test.2_1.xml delete mode 100644 modules/pantheon/tag1_d7es/tests/tag1_d7es_test.2_2.xml delete mode 100644 modules/pantheon/tag1_d7es/tests/tag1_d7es_test.3_0.xml delete mode 100644 modules/pantheon/tag1_d7es/tests/tag1_d7es_test.3_1.xml delete mode 100644 modules/pantheon/tag1_d7es/tests/tag1_d7es_test.4_0.xml delete mode 100644 modules/pantheon/tag1_d7es/tests/tag1_d7es_test.info delete mode 100644 modules/pantheon/tag1_d7es/tests/tag1_d7es_test.module delete mode 100644 modules/pantheon/tag1_d7es/tests/tag1_d7es_update.test diff --git a/modules/pantheon/tag1_d7es/.github/PULL_REQUEST_TEMPLATE.md b/modules/pantheon/tag1_d7es/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index ac7e5ff838..0000000000 --- a/modules/pantheon/tag1_d7es/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,17 +0,0 @@ -## Issue link(s) - - -## Description - - -## Test steps - - -## Manual Deploy Steps - - -## Followup Tasks - - -## Other information - diff --git a/modules/pantheon/tag1_d7es/.gitlab-ci.yml b/modules/pantheon/tag1_d7es/.gitlab-ci.yml deleted file mode 100644 index 19f32a3b68..0000000000 --- a/modules/pantheon/tag1_d7es/.gitlab-ci.yml +++ /dev/null @@ -1,31 +0,0 @@ -################ -# GitLabCI template for Drupal projects. -# -# This template is designed to give any Contrib maintainer everything they need to test, without requiring modification. -# It is also designed to keep up to date with Core Development automatically through the use of include files that can be centrally maintained. -# As long as you include the project, ref and three files below, any future updates added by the Drupal Association will be used in your -# pipelines automatically. However, you can modify this template if you have additional needs for your project. -# The full documentation is on https://project.pages.drupalcode.org/gitlab_templates/ -################ - -# For information on alternative values for 'ref' see https://project.pages.drupalcode.org/gitlab_templates/info/templates-version/ -# To test a Drupal 7 project, change the first include filename from .main.yml to .main-d7.yml -include: - - project: $_GITLAB_TEMPLATES_REPO - ref: $_GITLAB_TEMPLATES_REF - file: - - "/includes/include.drupalci.main-d7.yml" - - "/includes/include.drupalci.variables.yml" - - "/includes/include.drupalci.workflows.yml" - -################ -# Pipeline configuration variables are defined with default values and descriptions in the file -# https://git.drupalcode.org/project/gitlab_templates/-/blob/main/includes/include.drupalci.variables.yml -# Uncomment the lines below if you want to override any of the variables. The following is just an example. -################ -variables: - TARGET_PHP: '5.6' - _D7_DRUPAL_TEST_DEPENDENCIES: 'ctools' - OPT_IN_TEST_MAX_PHP: '1' -# OPT_IN_TEST_NEXT_MAJOR: '1' -# _CURL_TEMPLATES_REF: 'main' diff --git a/modules/pantheon/tag1_d7es/tests/tag1_d7es.test b/modules/pantheon/tag1_d7es/tests/tag1_d7es.test deleted file mode 100644 index 0859a9a163..0000000000 --- a/modules/pantheon/tag1_d7es/tests/tag1_d7es.test +++ /dev/null @@ -1,158 +0,0 @@ - 'Tag1 D7ES functional tests', - 'description' => 'Test module installation and behavior.', - 'group' => 'Tag1 D7ES', - 'dependencies' => array('tag1_d7es'), - ); - } - - /** - * {@inheritdoc} - */ - public function setUp(array $modules = array()) { - $modules[] = 'tag1_d7es'; - parent::setUp($modules); - } - - /** - * Get the site ID. - * - * @return string - * The site ID. - */ - protected function getSiteId() { - return variable_get('tag1_d7es_site_id'); - } - - /** - * Test module installation. - */ - public function testInstallation() { - $siteId = $this->getSiteId(); - $this->assertNotNull($siteId, 'A Site ID is generated'); - $this->assertTrue(tag1_d7es_uuid_is_valid($siteId), 'The Site ID is a valid UUID'); - $this->assertEqual(variable_get('tag1_d7es_phone_home'), 0, 'The phone-home variable is created and set to zero.'); - } - - /** - * Test request preflight. - */ - public function testPreflight() { - $site_id = ''; - $billing_email = ''; - $this->assertFalse(tag1_d7es_preflight($site_id, $billing_email)); - $this->assertWatchdogMessage( - "Unable to send data because the Site ID is not valid. Please visit the configuration page (under advanced settings) to correct it.", - array(), - 'Missing Site ID is logged.' - ); - - $site_id = $this->getSiteId(); - $this->assertFalse(tag1_d7es_preflight($site_id, $billing_email)); - $this->assertWatchdogMessage( - "Unable to send data because the billing email address is not provided. Please visit the configuration page to provide it.", - array(), - 'Missing billing email address is logged.' - ); - - $billing_email = 'test@example.com'; - $this->assertTrue(tag1_d7es_preflight($site_id, $billing_email)); - } - - /** - * Test phone-home payload creation. - */ - public function testPayload() { - $data = _tag1_d7es_payload(); - - $this->assertTrue(array_key_exists('siteId', $data), 'siteId key exists'); - $this->assertEqual($data['siteId'], $this->getSiteId(), 'Site ID matches the expected value'); - - $this->assertTrue(array_key_exists('billingEmail', $data), 'billingEmail key exists'); - $this->assertEqual($data['billingEmail'], variable_get('tag1_d7es_billing_email'), 'Billing email matches the expected value'); - - $this->assertTrue(array_key_exists('timestamp', $data), 'timestamp key exists'); - $this->assertNotNull($data['timestamp'], 'A value for the timestamp has been set'); - - $this->assertTrue(array_key_exists('siteUrl', $data), 'siteUrl key exists'); - $this->assertNotNull($data['siteUrl'], 'A value for the siteUrl has been set'); - $this->assertEqual($data['siteUrl'], $GLOBALS['base_url'], 'Site URL matches the expected value'); - - $this->assertTrue(array_key_exists('emails', $data), 'emails key exists'); - $this->assertIdentical($data['emails'], array(), 'No email address data has been supplied.'); - - $email_addresses = 'test1@example.com, test2@example.com'; - variable_set('tag1_d7es_email_addresses', $email_addresses); - $data = _tag1_d7es_payload(); - $this->assertIdentical($data['emails'], array_map('trim', explode(',', $email_addresses)), 'Updated email addresses are included as a list.'); - - $this->assertTrue(array_key_exists('core', $data), 'core key exists'); - $this->assertTrue(is_string($data['core']), 'Core value is a string'); - $this->assertTrue(array_key_exists('php', $data), 'php key exists'); - $this->assertTrue(is_string($data['php']), 'PHP value is a string'); - $this->assertTrue(array_key_exists('dbVersion', $data), 'dbVersion key exists'); - $this->assertTrue(is_string($data['dbVersion']), 'dbVersion value is a string'); - $this->assertTrue(array_key_exists('modules', $data), 'modules key exists'); - $this->assertTrue(is_array($data['modules']), 'Module data is an array'); - $this->assertTrue(array_key_exists('themes', $data), 'themes key exists'); - $this->assertTrue(is_array($data['themes']), 'Theme data is an array'); - - $this->assertFalse(array_key_exists('pantheonSiteId', $data)); - $this->assertFalse(array_key_exists('pantheonBuildId', $data)); - } - - /** - * Test module uninstallation. - */ - public function testUninstall() { - $this->assertTrue(module_exists('tag1_d7es')); - // Set manually-configured variables. - variable_set('tag1_d7es_billing_email', 'test@example.com'); - variable_set('tag1_d7es_email_addresses', 'test@example.com'); - variable_set('tag1_d7es_endpoint', 'some url'); - - // Disable and uninstall. - module_disable(array('tag1_d7es')); - drupal_uninstall_modules(array('tag1_d7es')); - - // Assert module uninstalled and variables are no longer present. - $this->assertFalse(module_exists('tag1_d7es')); - $this->assertNull(variable_get('tag1_d7es_site_id')); - $this->assertNull(variable_get('tag1_d7es_phone_home')); - $this->assertNull(variable_get('tag1_d7es_billing_email')); - $this->assertNull(variable_get('tag1_d7es_email_addresses')); - $this->assertNull(variable_get('tag1_d7es_endpoint')); - $this->assertNull(variable_get('tag1_d7es_send_update_emails')); - } - - /** - * Verify that a watchdog message has been entered. - * - * @param string $watchdog_message - * The watchdog message. - * @param array $variables - * The array of variables passed to watchdog(). - * @param string $message - * The assertion message. - */ - protected function assertWatchdogMessage($watchdog_message, $variables, $message) { - $status = (bool) db_query_range( - "SELECT 1 FROM {watchdog} WHERE message = :message AND variables = :variables", - 0, - 1, - array(':message' => $watchdog_message, ':variables' => serialize($variables)))->fetchField(); - return $this->assert($status, format_string('@message', array('@message' => $message))); - } - -} diff --git a/modules/pantheon/tag1_d7es/tests/tag1_d7es_admin.test b/modules/pantheon/tag1_d7es/tests/tag1_d7es_admin.test deleted file mode 100644 index bf5fa41dfe..0000000000 --- a/modules/pantheon/tag1_d7es/tests/tag1_d7es_admin.test +++ /dev/null @@ -1,123 +0,0 @@ - 'Tag1 D7ES configuration test', - 'description' => 'Test module configuration.', - 'group' => 'Tag1 D7ES', - 'dependencies' => array('tag1_d7es'), - ); - } - - /** - * {@inheritdoc} - */ - public function setUp(array $modules = array()) { - $modules[] = 'tag1_d7es'; - parent::setUp($modules); - - $this->user = $this->drupalCreateUser(array( - 'administer site configuration', - )); - } - - /** - * Test the module configuration form. - */ - public function testConfiguration() { - $this->drupalGet('admin/config/system/tag1-d7es'); - $this->assertResponse(403, 'Anonymous user cannot see module configurations.'); - - $this->drupalLogin($this->user); - $this->drupalGet('admin/config/system/tag1-d7es'); - $this->assertResponse(200, 'Admin user can see module configurations.'); - - $this->assertFieldById('edit-tag1-d7es-billing-email', '', 'A field for the billing email address exists.'); - $this->assertFieldById('edit-tag1-d7es-email-addresses', '', 'A field to specify email addresses exists.'); - $valid_site_id = variable_get('tag1_d7es_site_id'); - $this->assertFieldById('edit-tag1-d7es-site-id', $valid_site_id, 'A field to set the Site ID exists and matches the current variable.'); - $this->assertNoText(t('Drush release XML source'), 'Drush URL is not exposed.'); - - $edit = array(); - $edit['tag1_d7es_site_id'] = 'invalid-site-id'; - $this->drupalPost('admin/config/system/tag1-d7es', $edit, t('Save configuration')); - $this->assertText(t('The Site ID is not a valid UUID.')); - $this->assertText(t('@field_name field is required.', array('@field_name' => t('Billing email address')))); - $this->assertText(t('@field_name field is required.', array('@field_name' => t('Notification email addresses')))); - $billing_email = 'some value'; - $edit['tag1_d7es_site_id'] = $valid_site_id; - $edit['tag1_d7es_billing_email'] = $billing_email; - $email_addresses = 'test1@example.com,test2@example.com'; - $edit['tag1_d7es_email_addresses'] = $email_addresses; - $this->drupalPost('admin/config/system/tag1-d7es', $edit, t('Save configuration')); - $this->assertNoText(t('The Site ID is not a valid UUID.')); - $this->assertNoText(t('@field_name field is required.', array('@field_name' => t('Billing email address')))); - $this->assertNoText(t('@field_name field is required.', array('@field_name' => t('Notification email addresses')))); - - $this->assertEqual(variable_get('tag1_d7es_billing_email'), $billing_email, 'Billing email updated successfully.'); - $this->assertFieldById('edit-tag1-d7es-billing-email', $billing_email, 'The updated billing email is displayed in the field.'); - $this->assertEqual(variable_get('tag1_d7es_email_addresses'), $email_addresses, 'Email addresses updated successfully.'); - $this->assertFieldById('edit-tag1-d7es-email-addresses', $email_addresses, 'The updated email addresses are displayed in the field.'); - - $edit['tag1_d7es_site_id'] = ''; - $this->drupalPost('admin/config/system/tag1-d7es', $edit, t('Save configuration')); - $this->assertText(t('@field_name field is required.', array('@field_name' => t('Site ID')))); - $new_site_id = tag1_d7es_uuid_generate(); - $edit['tag1_d7es_site_id'] = $new_site_id; - $this->drupalPost('admin/config/system/tag1-d7es', $edit, t('Save configuration')); - $this->assertNoText(t('@field_name field is required.', array('@field_name' => t('Site ID')))); - $this->assertEqual(variable_get('tag1_d7es_site_id'), $new_site_id, 'Manual Site ID updated successfully.'); - $this->assertFieldById('edit-tag1-d7es-site-id', $new_site_id, 'The updated manual site ID is displayed in the field.'); - - $this->assertFieldById('edit-tag1-d7es-endpoint', '', 'A field for changing the API endpoint exists.'); - $prod_endpoint = TAG1_D7ES_ENDPOINT; - $this->assertEqual($prod_endpoint, _tag1_d7es_get_endpoint(), 'The default API endpoint is to the production environment.'); - $new_endpoint = 'some other string'; - $edit['tag1_d7es_endpoint'] = $new_endpoint; - $this->drupalPost('admin/config/system/tag1-d7es', $edit, t('Save configuration')); - $this->assertEqual(variable_get('tag1_d7es_endpoint'), $new_endpoint, 'Custom API endpoint updated successfully.'); - $this->assertFieldById('edit-tag1-d7es-endpoint', $new_endpoint, 'The updated custom API endpoint is displayed in the field.'); - $edit['tag1_d7es_endpoint'] = ''; - $this->drupalPost('admin/config/system/tag1-d7es', $edit, t('Save configuration')); - $this->assertEqual($prod_endpoint, _tag1_d7es_get_endpoint(), 'The default API endpoint can be restored.'); - - $this->assertNoText('Continue to send core "Available updates" notifications', 'Update notifications message does not display'); - module_enable(array('update')); - $this->drupalGet('admin/config/system/tag1-d7es'); - $this->assertNoText('Continue to send core "Available updates" notifications', 'Update notifications message does not display if the module is enabled without configuration'); - variable_set('update_notify_emails', array('test@example.com')); - $this->drupalGet('admin/config/system/tag1-d7es'); - $this->assertText('Continue to send core "Available updates" notifications', 'Update notifications message displays when module is enabled and configured.'); - $this->assertNoFieldChecked('edit-tag1-d7es-send-update-emails', 'Sending update notifications is disabled by default.'); - $edit['tag1_d7es_send_update_emails'] = TRUE; - $this->drupalPost('admin/config/system/tag1-d7es', $edit, t('Save configuration')); - $this->assertFieldChecked('edit-tag1-d7es-send-update-emails', 'Sending update notifications can be enabled.'); - } - - /** - * Tests the display of the release XML URL. - */ - public function testDrushReleaseXml() { - $release_xml = 'https://updates.drupal.org/release-history'; - variable_set('update_fetch_url', $release_xml); - $this->drupalLogin($this->user); - $this->drupalGet('admin/config/system/tag1-d7es'); - $this->assertText(t('Drush release XML source'), 'Drush URL markup is displayed.'); - } - -} diff --git a/modules/pantheon/tag1_d7es/tests/tag1_d7es_admin_ctools.test b/modules/pantheon/tag1_d7es/tests/tag1_d7es_admin_ctools.test deleted file mode 100644 index 584aea7ac0..0000000000 --- a/modules/pantheon/tag1_d7es/tests/tag1_d7es_admin_ctools.test +++ /dev/null @@ -1,40 +0,0 @@ - 'Tag1 D7ES + CTools configuration test', - 'description' => 'Test module configuration when CTools is enabled.', - 'group' => 'Tag1 D7ES', - 'dependencies' => array('ctools', 'tag1_d7es'), - ); - } - - /** - * {@inheritdoc} - */ - public function setUp(array $modules = array()) { - $modules[] = 'ctools'; - $modules[] = 'tag1_d7es'; - parent::setUp($modules); - - $this->user = $this->drupalCreateUser(array( - 'administer site configuration', - )); - } - -} diff --git a/modules/pantheon/tag1_d7es/tests/tag1_d7es_ctools.test b/modules/pantheon/tag1_d7es/tests/tag1_d7es_ctools.test deleted file mode 100644 index 104db0565d..0000000000 --- a/modules/pantheon/tag1_d7es/tests/tag1_d7es_ctools.test +++ /dev/null @@ -1,29 +0,0 @@ - 'Tag1 D7ES + CTools integration tests', - 'description' => 'Test module installation and behavior when CTools is enabled.', - 'group' => 'Tag1 D7ES', - 'dependencies' => array('ctools', 'tag1_d7es'), - ); - } - - /** - * {@inheritdoc} - */ - public function setUp(array $modules = array()) { - $modules[] = 'ctools'; - $modules[] = 'tag1_d7es'; - parent::setUp($modules); - } - -} diff --git a/modules/pantheon/tag1_d7es/tests/tag1_d7es_fetch_url.test b/modules/pantheon/tag1_d7es/tests/tag1_d7es_fetch_url.test deleted file mode 100644 index 6f056844f4..0000000000 --- a/modules/pantheon/tag1_d7es/tests/tag1_d7es_fetch_url.test +++ /dev/null @@ -1,53 +0,0 @@ - 'Tag1 D7ES update_fetch_url tests', - 'description' => 'Test customized release datasource configuration', - 'group' => 'Tag1 D7ES', - 'dependencies' => array('tag1_d7es'), - ); - } - - /** - * Tests installation and configuration. - */ - public function testUpdateFetchUrl() { - // Installation. - $previous_fetch_url = 'https://updates.drupal.org/release-history'; - variable_set('update_fetch_url', $previous_fetch_url); - module_enable(['tag1_d7es']); - $this->assertEqual(variable_get('tag1_d7es_original_update_fetch_url'), $previous_fetch_url); - - // Disable and uninstall. - module_disable(array('tag1_d7es')); - drupal_uninstall_modules(array('tag1_d7es')); - $this->assertNull(variable_get('tag1_d7es_original_update_fetch_url')); - $this->assertEqual(variable_get('update_fetch_url'), $previous_fetch_url); - } - - /** - * Test the update_fetch_url customization. - */ - public function testUpdateFetchUrlPersonalization() { - $update_fetch_url = tag1_d7es_personalize_updates_endpoint('test@example.com'); - $this->assertEqual($update_fetch_url, 'https://test@example.com:dGVzdEBleGFtcGxlLmNvbQ==@updates.tag1.com/release-history'); - } - - /** - * Test the drush url customization. - */ - public function testDrushUrlPersonalization() { - $drush_update_url = tag1_d7es_personalize_drush_source_endpoint('test@example.com'); - $this->assertEqual($drush_update_url, 'https://test%40example.com:dGVzdEBleGFtcGxlLmNvbQ%3D%3D@updates.tag1.com/release-history'); - } - -} diff --git a/modules/pantheon/tag1_d7es/tests/tag1_d7es_mail.test b/modules/pantheon/tag1_d7es/tests/tag1_d7es_mail.test deleted file mode 100644 index 7b4fb18af2..0000000000 --- a/modules/pantheon/tag1_d7es/tests/tag1_d7es_mail.test +++ /dev/null @@ -1,97 +0,0 @@ - 'Tag1 D7ES Update email notification', - 'description' => 'Tests our configurable override of the Update Status notification.', - 'group' => 'Tag1 D7ES', - ); - } - - /** - * {@inheritdoc} - */ - public function setUp() { - parent::setUp(array('update', 'tag1_d7es')); - - // Set this class as the SMTP library. - variable_set('mail_system', array('default-system' => 'Tag1D7esMailTestCase')); - } - - /** - * Assert that the pluggable mail system is functional. - */ - public function testPluggableFramework() { - global $language; - - // Use MailTestCase for sending a message. - $message = drupal_mail('simpletest', 'mail_test', 'testing@example.com', $language); - - // Assert whether the message was sent through the send function. - $this->assertEqual(self::$sentMessage['to'], 'testing@example.com', 'Pluggable mail system is extendable.'); - } - - /** - * Test that Update message sending may be configured. - * - * @see tag1_d7es_mail_alter() - */ - public function testUpdateMessage() { - global $language; - - // Reset the class variable holding a copy of the last sent message. - self::$sentMessage = NULL; - - // Send a test message that tag1_d7es_mail_alter should cancel. - $message = drupal_mail('update', 'status_notify', 'to@example.com', $language); - - // Assert that the message was not actually sent. - $this->assertNull(self::$sentMessage, 'Message was not sent.'); - - // Rerun the above but allow the message to be sent. - self::$sentMessage = NULL; - variable_set('tag1_d7es_send_update_emails', 1); - $message = drupal_mail('update', 'status_notify', 'to@example.com', $language); - $this->assertTrue(self::$sentMessage['send'], 'Message was sent.'); - } - - /** - * Concatenate and wrap the e-mail body for plain-text mails. - * - * @see DefaultMailSystem - */ - public function format(array $message) { - // Join the body array into one string. - $message['body'] = implode("\n\n", $message['body']); - // Convert any HTML to plain-text. - $message['body'] = drupal_html_to_text($message['body']); - // Wrap the mail body for sending. - $message['body'] = drupal_wrap_mail($message['body']); - return $message; - } - - /** - * Send function that is called through the mail system. - */ - public function mail(array $message) { - self::$sentMessage = $message; - } - -} diff --git a/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.1_0.xml b/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.1_0.xml deleted file mode 100644 index ea2b7838c5..0000000000 --- a/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.1_0.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - Tag1 D7ES test - tag1_d7es_test - Drupal - 7.x - 1 - 1 - 1 - published - http://example.com/project/tag1_d7es_test - - ProjectsModules - - - - tag1_d7es_test 7.x-1.0 - 7.x-1.0 - DRUPAL-7--1-0 - 1 - 0 - published - http://example.com/tag1_d7es_test-7-x-1-0-release - http://example.com/tag1_d7es_test-7.x-1.0.tar.gz - 1250424521 - b966255555d9c9b86d480ca08cfaa98e - 1073741824 - - Release typeNew features - Release typeBug fixes - - - - diff --git a/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.1_1.xml b/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.1_1.xml deleted file mode 100644 index b0b3a7dc1d..0000000000 --- a/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.1_1.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - Tag1 D7ES test - tag1_d7es_test - Drupal - 7.x - 1 - 1 - 1 - published - http://example.com/project/tag1_d7es_test - - ProjectsModules - - - - tag1_d7es_test 7.x-1.1 - 7.x-1.1 - DRUPAL-7--1-1 - 1 - 1 - published - http://example.com/tag1_d7es_test-7-x-1-1-release - http://example.com/tag1_d7es_test-7.x-1.1.tar.gz - 1250424521 - b966255555d9c9b86d480ca08cfaa98e - 1073741824 - - Release typeNew features - Release typeBug fixes - - - - tag1_d7es_test 7.x-1.0 - 7.x-1.0 - DRUPAL-7--1-0 - 1 - 0 - published - http://example.com/tag1_d7es_test-7-x-1-0-release - http://example.com/tag1_d7es_test-7.x-1.0.tar.gz - 1250424521 - b966255555d9c9b86d480ca08cfaa98e - 1073741824 - - Release typeNew features - Release typeBug fixes - - - - diff --git a/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.1_2.xml b/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.1_2.xml deleted file mode 100644 index 30affb3ca4..0000000000 --- a/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.1_2.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - Tag1 D7ES test - tag1_d7es_test - Drupal - 7.x - 1 - 1 - 1 - published - http://example.com/project/tag1_d7es_test - - ProjectsModules - - - - tag1_d7es_test 7.x-1.1 - 7.x-1.1 - DRUPAL-7--1-1 - 1 - 1 - published - http://example.com/tag1_d7es_test-7-x-1-1-release - http://example.com/tag1_d7es_test-7.x-1.1.tar.gz - 1250424521 - b966255555d9c9b86d480ca08cfaa98e - 1073741824 - - Release typeNew features - Release typeBug fixes - Release typeSecurity update - - - - tag1_d7es_test 7.x-1.0 - 7.x-1.0 - DRUPAL-7--1-0 - 1 - 0 - published - http://example.com/tag1_d7es_test-7-x-1-0-release - http://example.com/tag1_d7es_test-7.x-1.0.tar.gz - 1250424521 - b966255555d9c9b86d480ca08cfaa98e - 1073741824 - - Release typeNew features - Release typeBug fixes - - - - diff --git a/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.1_3.xml b/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.1_3.xml deleted file mode 100644 index 4f0b1bec7a..0000000000 --- a/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.1_3.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - Tag1 D7ES test - tag1_d7es_test - Drupal - 7.x - 2 - 2 - 2 - published - http://example.com/project/tag1_d7es_test - - ProjectsModules - - - - tag1_d7es_test 7.x-2.0 - 7.x-2.0 - DRUPAL-7--2-0 - 2 - 0 - published - http://example.com/tag1_d7es_test-7-x-2-0-release - http://example.com/tag1_d7es_test-7.x-2.0.tar.gz - 1250424521 - b966255555d9c9b86d480ca08cfaa98e - 1073741824 - - Release typeNew features - Release typeBug fixes - - - - tag1_d7es_test 7.x-1.0 - 7.x-1.0 - DRUPAL-7--1-0 - 1 - 0 - published - http://example.com/tag1_d7es_test-7-x-1-0-release - http://example.com/tag1_d7es_test-7.x-1.0.tar.gz - 1250424521 - b966255555d9c9b86d480ca08cfaa98e - 1073741824 - - Release typeNew features - Release typeBug fixes - - - - diff --git a/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.2_0.xml b/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.2_0.xml deleted file mode 100644 index 03a90f0d92..0000000000 --- a/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.2_0.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - Tag1 D7ES test - tag1_d7es_test - Drupal - 7.x - 1 - 1 - 1 - unsupported - http://example.com/project/tag1_d7es_test - - ProjectsModules - - - - tag1_d7es_test 7.x-1.0 - 7.x-1.0 - DRUPAL-7--1-0 - 1 - 0 - published - http://example.com/tag1_d7es_test-7-x-1-0-release - http://example.com/tag1_d7es_test-7.x-1.0.tar.gz - 1250424521 - b966255555d9c9b86d480ca08cfaa98e - 1073741824 - - Release typeNew features - Release typeBug fixes - - - - diff --git a/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.2_1.xml b/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.2_1.xml deleted file mode 100644 index 3ab96e2dc7..0000000000 --- a/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.2_1.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - Tag1 D7ES test - tag1_d7es_test - Tag1 - 7.x - 1 - 1 - 1 - tag1_d7es - http://example.com/project/tag1_d7es_test - - ProjectsModules - - - - tag1_d7es_test 7.x-1.1 - 7.x-1.1 - DRUPAL-7--1-1 - 1 - 1 - published - http://example.com/tag1_d7es_test-7-x-1-1-release - http://example.com/tag1_d7es_test-7.x-1.1.tar.gz - 1250424521 - b966255555d9c9b86d480ca08cfaa98e - 1073741824 - - Release typeNew features - Release typeBug fixes - Release typeTag1 D7ES - - - - tag1_d7es_test 7.x-1.0 - 7.x-1.0 - DRUPAL-7--1-0 - 1 - 0 - published - http://example.com/tag1_d7es_test-7-x-1-0-release - http://example.com/tag1_d7es_test-7.x-1.0.tar.gz - 1250424521 - b966255555d9c9b86d480ca08cfaa98e - 1073741824 - - Release typeNew features - Release typeBug fixes - - - - diff --git a/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.2_2.xml b/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.2_2.xml deleted file mode 100644 index 49365c90ac..0000000000 --- a/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.2_2.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - Tag1 D7ES test - tag1_d7es_test - Tag1 - 7.x - 1 - 1 - 1 - tag1_d7es - http://example.com/project/tag1_d7es_test - - ProjectsModules - - - - tag1_d7es_test 7.x-1.1 - 7.x-1.1 - DRUPAL-7--1-1 - 1 - 1 - published - http://example.com/tag1_d7es_test-7-x-1-1-release - http://example.com/tag1_d7es_test-7.x-1.1.tar.gz - 1250424521 - b966255555d9c9b86d480ca08cfaa98e - 1073741824 - - Release typeNew features - Release typeBug fixes - Release typeSecurity update - Release typeTag1 D7ES - - - - tag1_d7es_test 7.x-1.0 - 7.x-1.0 - DRUPAL-7--1-0 - 1 - 0 - published - http://example.com/tag1_d7es_test-7-x-1-0-release - http://example.com/tag1_d7es_test-7.x-1.0.tar.gz - 1250424521 - b966255555d9c9b86d480ca08cfaa98e - 1073741824 - - Release typeNew features - Release typeBug fixes - - - - diff --git a/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.3_0.xml b/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.3_0.xml deleted file mode 100644 index 4080ff95b6..0000000000 --- a/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.3_0.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - Tag1 D7ES test - tag1_d7es_test - Tag1 - 7.x - 1 - 1 - 1 - insecure - http://example.com/project/tag1_d7es_test - - ProjectsModules - - - - tag1_d7es_test 7.x-1.1 - 7.x-1.1 - DRUPAL-7--1-1 - 1 - 1 - published - http://example.com/tag1_d7es_test-7-x-1-1-release - http://example.com/tag1_d7es_test-7.x-1.1.tar.gz - 1250424521 - b966255555d9c9b86d480ca08cfaa98e - 1073741824 - - Release typeNew features - Release typeBug fixes - - - - tag1_d7es_test 7.x-1.0 - 7.x-1.0 - DRUPAL-7--1-0 - 1 - 0 - published - http://example.com/tag1_d7es_test-7-x-1-0-release - http://example.com/tag1_d7es_test-7.x-1.0.tar.gz - 1250424521 - b966255555d9c9b86d480ca08cfaa98e - 1073741824 - - Release typeNew features - Release typeBug fixes - - - - diff --git a/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.3_1.xml b/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.3_1.xml deleted file mode 100644 index 539533f2e7..0000000000 --- a/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.3_1.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - Tag1 D7ES test - tag1_d7es_test - Tag1 - 7.x - 1 - 1 - 1 - insecure - This is a custom message. - http://example.com/project/tag1_d7es_test - - ProjectsModules - - - - tag1_d7es_test 7.x-1.1 - 7.x-1.1 - DRUPAL-7--1-1 - 1 - 1 - published - http://example.com/tag1_d7es_test-7-x-1-1-release - http://example.com/tag1_d7es_test-7.x-1.1.tar.gz - 1250424521 - b966255555d9c9b86d480ca08cfaa98e - 1073741824 - - Release typeNew features - Release typeBug fixes - - - - tag1_d7es_test 7.x-1.0 - 7.x-1.0 - DRUPAL-7--1-0 - 1 - 0 - published - http://example.com/tag1_d7es_test-7-x-1-0-release - http://example.com/tag1_d7es_test-7.x-1.0.tar.gz - 1250424521 - b966255555d9c9b86d480ca08cfaa98e - 1073741824 - - Release typeNew features - Release typeBug fixes - - - - diff --git a/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.4_0.xml b/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.4_0.xml deleted file mode 100644 index 8818e37d41..0000000000 --- a/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.4_0.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - Tag1 D7ES test - tag1_d7es_test - Tag1 - 7.x - 2 - 2 - 2 - unsupported - http://example.com/project/tag1_d7es_test - - ProjectsModules - - - - tag1_d7es_test 7.x-2.0 - 7.x-2.0 - DRUPAL-7--2-0 - 2 - 0 - published - http://example.com/tag1_d7es_test-7-x-2-0-release - http://example.com/tag1_d7es_test-7.x-2.0.tar.gz - 1250424521 - b966255555d9c9b86d480ca08cfaa98e - 1073741824 - - Release typeNew features - Release typeBug fixes - - - - tag1_d7es_test 7.x-1.1 - 7.x-1.1 - DRUPAL-7--1-1 - 1 - 1 - published - http://example.com/tag1_d7es_test-7-x-1-1-release - http://example.com/tag1_d7es_test-7.x-1.1.tar.gz - 1250424521 - b966255555d9c9b86d480ca08cfaa98e - 1073741824 - - Release typeNew features - Release typeBug fixes - - - - tag1_d7es_test 7.x-1.0 - 7.x-1.0 - DRUPAL-7--1-0 - 1 - 0 - published - http://example.com/tag1_d7es_test-7-x-1-0-release - http://example.com/tag1_d7es_test-7.x-1.0.tar.gz - 1250424521 - b966255555d9c9b86d480ca08cfaa98e - 1073741824 - - Release typeNew features - Release typeBug fixes - - - - diff --git a/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.info b/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.info deleted file mode 100644 index 69a416afca..0000000000 --- a/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.info +++ /dev/null @@ -1,11 +0,0 @@ -name = Tag1 D7ES Test -description = Support module for tag1_d7es module testing. -package = Testing -core = 7.x -hidden = TRUE - -; Information added by Drupal.org packaging script on 2024-11-27 -version = "7.x-1.1" -core = "7.x" -project = "tag1_d7es" -datestamp = "1732731772" diff --git a/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.module b/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.module deleted file mode 100644 index 97ef13aceb..0000000000 --- a/modules/pantheon/tag1_d7es/tests/tag1_d7es_test.module +++ /dev/null @@ -1,51 +0,0 @@ - 'Update test', - 'page callback' => 'tag1_d7es_test_mock_page', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - - return $items; -} - -/** - * Page callback: Prints mock XML for the Update Manager module. - * - * @see update_test_menu() - * @see update_test_mock_page() - */ -function tag1_d7es_test_mock_page($project_name) { - $xml_map = variable_get('update_test_xml_map', FALSE); - if (isset($xml_map[$project_name])) { - $availability_scenario = $xml_map[$project_name]; - } - elseif (isset($xml_map['#all'])) { - $availability_scenario = $xml_map['#all']; - } - else { - // The test didn't specify (for example, the webroot has other modules and - // themes installed but they're disabled by the version of the site - // running the test. So, we default to a file we know won't exist, so at - // least we'll get an empty page from readfile instead of a bunch of - // Drupal page output. - $availability_scenario = '#broken#'; - } - - $path = drupal_get_path('module', 'tag1_d7es_test'); - readfile("$path/$project_name.$availability_scenario.xml"); -} diff --git a/modules/pantheon/tag1_d7es/tests/tag1_d7es_update.test b/modules/pantheon/tag1_d7es/tests/tag1_d7es_update.test deleted file mode 100644 index 337d87d13a..0000000000 --- a/modules/pantheon/tag1_d7es/tests/tag1_d7es_update.test +++ /dev/null @@ -1,539 +0,0 @@ - 'Update report testing', - 'description' => 'Tests the Tag1 D7ES customizations to the Update Manager report.', - 'group' => 'Tag1 D7ES', - ); - } - - /** - * {@inheritdoc} - */ - public function setUp() { - parent::setUp('update_test', 'update', 'tag1_d7es_test'); - $admin_user = $this->drupalCreateUser(array('administer site configuration', 'administer modules')); - $this->drupalLogin($admin_user); - } - - /** - * Assert that the given class is present in the HTML. - * - * Since we are not including update info for Drupal core, these classes will - * only show for our module listing. - * - * @param string $class - * The class to assert. - */ - public function assertClass($class) { - $elements = $this->xpath("//tr[contains(@class,:class)]", array(':class' => $class)); - $this->assertTrue(!empty($elements), "CSS class '$class' found."); - } - - /** - * Assert the expected status message is displayed. - * - * @param string $expected - * The status to assert. - */ - public function assertStatus($expected) { - $statuses = array( - TAG1_D7ES_UPDATE_TEST_CURRENT => t('Up to date'), - TAG1_D7ES_UPDATE_TEST_AVAILABLE => t('Update available'), - TAG1_D7ES_UPDATE_TEST_SECURITY => t('Security update required!'), - TAG1_D7ES_UPDATE_TEST_UNSECURE => t('Project not secure'), - TAG1_D7ES_UPDATE_TEST_UNSUPPORTED => t('Not supported!'), - ); - if (array_key_exists($expected, $statuses)) { - $this->assertText($statuses[$expected]); - unset($statuses[$expected]); - foreach ($statuses as $status) { - $this->assertNoText($status); - } - } - } - - /** - * Tests messaging overrides with a still-supported module. - */ - public function testSupportedMessaging() { - $system_info = array( - '#all' => array( - 'version' => '7.0', - ), - 'tag1_d7es_test' => array( - 'project' => 'tag1_d7es_test', - 'version' => '7.x-1.0', - 'hidden' => FALSE, - ), - ); - variable_set('update_test_system_info', $system_info); - $this->refreshUpdateStatus( - array( - 'tag1_d7es_test' => '1_0', - ), - 'tag1-d7es-update-test' - ); - $this->assertRaw('

' . t('Modules') . '

'); - $this->assertRaw(l(t('Tag1 D7ES test'), 'http://example.com/project/tag1_d7es_test'), 'Link to tag1_d7es_test project appears.'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_CURRENT); - $this->assertClass('ok'); - - // Enable our module. Since the project is still supported by the community, - // messaging should not change. - module_enable(['tag1_d7es']); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_CURRENT); - $this->assertClass('ok'); - - $now = time(); - // Set an older phone-home. - variable_set('tag1_d7es_phone_home', $now - (86400 * 30)); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_CURRENT); - $this->assertClass('ok'); - - // Update to a recent phone-home. - variable_set('tag1_d7es_phone_home', $now); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_CURRENT); - $this->assertClass('ok'); - } - - /** - * Tests a still-supported module with a pending update. - */ - public function testSupportedWithUpdateMessaging() { - $system_info = array( - '#all' => array( - 'version' => '7.0', - ), - 'tag1_d7es_test' => array( - 'project' => 'tag1_d7es_test', - 'version' => '7.x-1.0', - 'hidden' => FALSE, - ), - ); - variable_set('update_test_system_info', $system_info); - $this->refreshUpdateStatus( - array( - 'tag1_d7es_test' => '1_1', - ), - 'tag1-d7es-update-test' - ); - $this->assertRaw(l(t('Tag1 D7ES test'), 'http://example.com/project/tag1_d7es_test'), 'Link to tag1_d7es_test project appears.'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_AVAILABLE); - $this->assertClass('warning'); - - // Enable our module. Since the project is still supported by the community, - // messaging should not change. - module_enable(['tag1_d7es']); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_AVAILABLE); - $this->assertClass('warning'); - - $now = time(); - // Set an older phone-home. - variable_set('tag1_d7es_phone_home', $now - (86400 * 30)); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_AVAILABLE); - $this->assertClass('warning'); - - // Update to a recent phone-home. - variable_set('tag1_d7es_phone_home', $now); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_AVAILABLE); - $this->assertClass('warning'); - } - - /** - * Tests a still-supported module with a pending security update. - */ - public function testSupportedWithSecurityUpdateMessaging() { - $system_info = array( - '#all' => array( - 'version' => '7.0', - ), - 'tag1_d7es_test' => array( - 'project' => 'tag1_d7es_test', - 'version' => '7.x-1.0', - 'hidden' => FALSE, - ), - ); - variable_set('update_test_system_info', $system_info); - $this->refreshUpdateStatus( - array( - 'tag1_d7es_test' => '1_2', - ), - 'tag1-d7es-update-test' - ); - $this->assertRaw(l(t('Tag1 D7ES test'), 'http://example.com/project/tag1_d7es_test'), 'Link to tag1_d7es_test project appears.'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_SECURITY); - $this->assertClass('error'); - - // Enable our module. Since the project is still supported by the community, - // messaging should not change. - module_enable(['tag1_d7es']); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_SECURITY); - $this->assertClass('error'); - - $now = time(); - // Set an older phone-home. - variable_set('tag1_d7es_phone_home', $now - (86400 * 30)); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_SECURITY); - $this->assertClass('error'); - - // Update to a recent phone-home. - variable_set('tag1_d7es_phone_home', $now); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_SECURITY); - $this->assertClass('error'); - } - - /** - * Tests a still-supported module with a major branch update. - */ - public function testSupportedWithMajorUpdateMessaging() { - $system_info = array( - '#all' => array( - 'version' => '7.0', - ), - 'tag1_d7es_test' => array( - 'project' => 'tag1_d7es_test', - 'version' => '7.x-1.0', - 'hidden' => FALSE, - ), - ); - variable_set('update_test_system_info', $system_info); - $this->refreshUpdateStatus( - array( - 'tag1_d7es_test' => '1_3', - ), - 'tag1-d7es-update-test' - ); - $this->assertRaw(l(t('Tag1 D7ES test'), 'http://example.com/project/tag1_d7es_test'), 'Link to tag1_d7es_test project appears.'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_UNSUPPORTED); - $this->assertClass('error'); - - // Enable our module. Since the project is still supported by the community, - // messaging should not change. - module_enable(['tag1_d7es']); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_UNSUPPORTED); - $this->assertClass('error'); - $this->assertText('Recommended version:'); - - $now = time(); - // Set an older phone-home. - variable_set('tag1_d7es_phone_home', $now - (86400 * 30)); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_UNSUPPORTED); - $this->assertClass('error'); - $this->assertText('Recommended version:'); - - // Update to a recent phone-home. - variable_set('tag1_d7es_phone_home', $now); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_UNSUPPORTED); - $this->assertClass('error'); - $this->assertText('Recommended version:'); - } - - /** - * Tests messaging overrides of an unsupported module. - */ - public function testUnsupportedMessaging() { - $system_info = array( - '#all' => array( - 'version' => '7.0', - ), - 'tag1_d7es_test' => array( - 'project' => 'tag1_d7es_test', - 'version' => '7.x-1.0', - 'hidden' => FALSE, - ), - ); - variable_set('update_test_system_info', $system_info); - $this->refreshUpdateStatus( - array( - 'tag1_d7es_test' => '2_0', - ), - 'tag1-d7es-update-test' - ); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_UNSUPPORTED); - $this->assertText(t('Project not supported:')); - $this->assertClass('error'); - - // Enable our module. - module_enable(['tag1_d7es']); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_UNSUPPORTED); - $this->assertText(t('Project not supported:')); - $this->assertClass('error'); - - // Set an older phone-home. - $now = time(); - variable_set('tag1_d7es_phone_home', $now - (86400 * 30)); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_UNSUPPORTED); - $this->assertText(t('Project not supported:')); - $this->assertClass('error'); - - // Update to a recent phone-home. The module is supported. - variable_set('tag1_d7es_phone_home', $now); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_CURRENT); - $this->assertNoText(t('Project not supported:')); - $this->assertClass('ok'); - } - - /** - * Tests messaging overrides of an unsupported module with a pending update. - */ - public function testUnsupportedWithUpdateMessaging() { - $system_info = array( - '#all' => array( - 'version' => '7.0', - ), - 'tag1_d7es_test' => array( - 'project' => 'tag1_d7es_test', - 'version' => '7.x-1.0', - 'hidden' => FALSE, - ), - ); - variable_set('update_test_system_info', $system_info); - $this->refreshUpdateStatus( - array( - 'tag1_d7es_test' => '2_1', - ), - 'tag1-d7es-update-test' - ); - - // No module-disabled check here; we assume that our custom XML feed will - // not be used without having the module installed. - // Enable our module. - module_enable(['tag1_d7es']); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_UNSUPPORTED); - $this->assertClass('error'); - - // Set an older phone-home. - $now = time(); - variable_set('tag1_d7es_phone_home', $now - (86400 * 30)); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_UNSUPPORTED); - $this->assertClass('error'); - - // Update to a recent phone-home. The module shows an available update. - variable_set('tag1_d7es_phone_home', $now); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_AVAILABLE); - $this->assertClass('warning'); - } - - /** - * Tests messaging overrides of an unsupported module with a security update. - */ - public function testUnsupportedWithSecurityUpdateMessaging() { - $system_info = array( - '#all' => array( - 'version' => '7.0', - ), - 'tag1_d7es_test' => array( - 'project' => 'tag1_d7es_test', - 'version' => '7.x-1.0', - 'hidden' => FALSE, - ), - ); - variable_set('update_test_system_info', $system_info); - $this->refreshUpdateStatus( - array( - 'tag1_d7es_test' => '2_2', - ), - 'tag1-d7es-update-test' - ); - - // No module-disabled check here; we assume that our custom XML feed will - // not be used without having the module installed. - // Enable our module. - module_enable(['tag1_d7es']); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_UNSUPPORTED); - $this->assertClass('error'); - - // Set an older phone-home. - $now = time(); - variable_set('tag1_d7es_phone_home', $now - (86400 * 30)); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_UNSUPPORTED); - $this->assertClass('error'); - - // Update to a recent phone-home. The module shows an available update. - variable_set('tag1_d7es_phone_home', $now); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_SECURITY); - $this->assertClass('error'); - } - - /** - * Tests messaging for a module that even we will not support. - */ - public function testCompletelyUnsupportedMessaging() { - $system_info = array( - '#all' => array( - 'version' => '7.0', - ), - 'tag1_d7es_test' => array( - 'project' => 'tag1_d7es_test', - 'version' => '7.x-1.0', - 'hidden' => FALSE, - ), - ); - variable_set('update_test_system_info', $system_info); - $this->refreshUpdateStatus( - array( - 'tag1_d7es_test' => '3_0', - ), - 'tag1-d7es-update-test' - ); - - // No module-disabled check here; we assume that our custom XML feed will - // not be used without having the module installed. - // Enable our module. - module_enable(['tag1_d7es']); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_UNSUPPORTED); - $this->assertClass('error'); - $this->assertText(t('Project not supported:')); - - // Set an older phone-home. - $now = time(); - variable_set('tag1_d7es_phone_home', $now - (86400 * 30)); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_UNSUPPORTED); - $this->assertClass('error'); - $this->assertText(t('Project not supported:')); - - // Update to a recent phone-home. The module shows an available update. - variable_set('tag1_d7es_phone_home', $now); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_UNSUPPORTED); - $this->assertClass('error'); - $this->assertText(t('Project not supported:')); - } - - /** - * Tests custom messaging for a module that even we will not support. - */ - public function testCustomUnsupportedMessaging() { - $system_info = array( - '#all' => array( - 'version' => '7.0', - ), - 'tag1_d7es_test' => array( - 'project' => 'tag1_d7es_test', - 'version' => '7.x-1.0', - 'hidden' => FALSE, - ), - ); - variable_set('update_test_system_info', $system_info); - $this->refreshUpdateStatus( - array( - 'tag1_d7es_test' => '3_1', - ), - 'tag1-d7es-update-test' - ); - - // No module-disabled check here; we assume that our custom XML feed will - // not be used without having the module installed. - // Enable our module. - module_enable(['tag1_d7es']); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_UNSUPPORTED); - $this->assertClass('error'); - $this->assertText(t('Project not supported:')); - $this->assertNoText('This is a custom message.'); - - // Set an older phone-home. - $now = time(); - variable_set('tag1_d7es_phone_home', $now - (86400 * 30)); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_UNSUPPORTED); - $this->assertClass('error'); - $this->assertText(t('Project not supported:')); - $this->assertNoText('This is a custom message.'); - - // Update to a recent phone-home. The module shows an available update. - variable_set('tag1_d7es_phone_home', $now); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_UNSUPPORTED); - $this->assertClass('error'); - $this->assertText(t('Project not supported:')); - $this->assertText('This is a custom message.'); - } - - /** - * Tests messaging for a module that distinguishes major branch support. - */ - public function testUnsupportedMajorMessaging() { - $system_info = array( - '#all' => array( - 'version' => '7.0', - ), - 'tag1_d7es_test' => array( - 'project' => 'tag1_d7es_test', - 'version' => '7.x-1.0', - 'hidden' => FALSE, - ), - ); - variable_set('update_test_system_info', $system_info); - $this->refreshUpdateStatus( - array( - 'tag1_d7es_test' => '4_0', - ), - 'tag1-d7es-update-test' - ); - - // No module-disabled check here; we assume that our custom XML feed will - // not be used without having the module installed. - // Enable our module. - module_enable(['tag1_d7es']); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_UNSUPPORTED); - $this->assertClass('error'); - $this->assertNoText(t('Recommended version:')); - - // Set an older phone-home. - $now = time(); - variable_set('tag1_d7es_phone_home', $now - (86400 * 30)); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_UNSUPPORTED); - $this->assertClass('error'); - $this->assertNoText(t('Recommended version:')); - - // Update to a recent phone-home. The module shows an available update. - variable_set('tag1_d7es_phone_home', $now); - $this->drupalGet('admin/reports/updates'); - $this->assertStatus(TAG1_D7ES_UPDATE_TEST_UNSUPPORTED); - $this->assertClass('error'); - $this->assertText(t('Recommended version:')); - } - -}