First commit

This commit is contained in:
Theodotos Andreou 2018-01-14 13:10:16 +00:00
commit c6e2478c40
13918 changed files with 2303184 additions and 0 deletions

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>AAA Update test</title>
<short_name>aaa_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<api_version>7.x</api_version>
<recommended_major>1</recommended_major>
<supported_majors>1</supported_majors>
<default_major>1</default_major>
<project_status>published</project_status>
<link>http://example.com/project/aaa_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<name>aaa_update_test 7.x-1.0</name>
<version>7.x-1.0</version>
<tag>DRUPAL-7--1-0</tag>
<version_major>1</version_major>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/aaa_update_test-7-x-1-0-release</release_link>
<download_link>http://example.com/aaa_update_test-7.x-1.0.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>

View file

@ -0,0 +1,11 @@
name = AAA Update test
description = Support module for update module testing.
package = Testing
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2017-06-21
version = "7.56"
project = "drupal"
datestamp = "1498069849"

View file

@ -0,0 +1,6 @@
<?php
/**
* @file
* Dummy module for testing Update status.
*/

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<error>No release history was found for the requested project (aaa_update_test).</error>

Binary file not shown.

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>BBB Update test</title>
<short_name>bbb_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<api_version>7.x</api_version>
<recommended_major>1</recommended_major>
<supported_majors>1</supported_majors>
<default_major>1</default_major>
<project_status>published</project_status>
<link>http://example.com/project/bbb_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<name>bbb_update_test 7.x-1.0</name>
<version>7.x-1.0</version>
<tag>DRUPAL-7--1-0</tag>
<version_major>1</version_major>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/bbb_update_test-7-x-1-0-release</release_link>
<download_link>http://example.com/bbb_update_test-7.x-1.0.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>

View file

@ -0,0 +1,11 @@
name = BBB Update test
description = Support module for update module testing.
package = Testing
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2017-06-21
version = "7.56"
project = "drupal"
datestamp = "1498069849"

View file

@ -0,0 +1,6 @@
<?php
/**
* @file
* Dummy module for testing Update status.
*/

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>CCC Update test</title>
<short_name>ccc_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<api_version>7.x</api_version>
<recommended_major>1</recommended_major>
<supported_majors>1</supported_majors>
<default_major>1</default_major>
<project_status>published</project_status>
<link>http://example.com/project/ccc_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<name>ccc_update_test 7.x-1.0</name>
<version>7.x-1.0</version>
<tag>DRUPAL-7--1-0</tag>
<version_major>1</version_major>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/ccc_update_test-7-x-1-0-release</release_link>
<download_link>http://example.com/ccc_update_test-7.x-1.0.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>

View file

@ -0,0 +1,11 @@
name = CCC Update test
description = Support module for update module testing.
package = Testing
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2017-06-21
version = "7.56"
project = "drupal"
datestamp = "1498069849"

View file

@ -0,0 +1,6 @@
<?php
/**
* @file
* Dummy module for testing Update status.
*/

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<api_version>7.x</api_version>
<recommended_major>7</recommended_major>
<supported_majors>7</supported_majors>
<default_major>7</default_major>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<name>Drupal 7.0</name>
<version>7.0</version>
<tag>DRUPAL-7-0</tag>
<version_major>7</version_major>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-7-0-release</release_link>
<download_link>http://example.com/drupal-7-0.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>

View file

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<api_version>7.x</api_version>
<recommended_major>7</recommended_major>
<supported_majors>7</supported_majors>
<default_major>7</default_major>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<name>Drupal 7.1</name>
<version>7.1</version>
<tag>DRUPAL-7-1</tag>
<version_major>7</version_major>
<version_patch>1</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-7-1-release</release_link>
<download_link>http://example.com/drupal-7-1.tar.gz</download_link>
<date>1250424581</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>2147483648</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 7.0</name>
<version>7.0</version>
<tag>DRUPAL-7-0</tag>
<version_major>7</version_major>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-7-0-release</release_link>
<download_link>http://example.com/drupal-7-0.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>

View file

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<api_version>7.x</api_version>
<recommended_major>7</recommended_major>
<supported_majors>7</supported_majors>
<default_major>7</default_major>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<name>Drupal 7.2</name>
<version>7.2</version>
<tag>DRUPAL-7-2</tag>
<version_major>7</version_major>
<version_patch>2</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-7-2-release</release_link>
<download_link>http://example.com/drupal-7-2.tar.gz</download_link>
<date>1250424641</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>4294967296</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>Drupal 7.1</name>
<version>7.1</version>
<tag>DRUPAL-7-1</tag>
<version_major>7</version_major>
<version_patch>1</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-7-1-release</release_link>
<download_link>http://example.com/drupal-7-1.tar.gz</download_link>
<date>1250424581</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>2147483648</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 7.0</name>
<version>7.0</version>
<tag>DRUPAL-7-0</tag>
<version_major>7</version_major>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-7-0-release</release_link>
<download_link>http://example.com/drupal-7-0.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>

View file

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<api_version>7.x</api_version>
<recommended_major>7</recommended_major>
<supported_majors>7</supported_majors>
<default_major>7</default_major>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<name>Drupal 7.0</name>
<version>7.0</version>
<tag>DRUPAL-7-0</tag>
<version_major>7</version_major>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-7-0-release</release_link>
<download_link>http://example.com/drupal-7-0.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 7.x-dev</name>
<version>7.x-dev</version>
<tag>DRUPAL-7</tag>
<version_major>7</version_major>
<version_extra>dev</version_extra>
<status>published</status>
<release_link>http://example.com/drupal-7-x-dev-release</release_link>
<download_link>http://example.com/drupal-7.x-dev.tar.gz</download_link>
<date>1250424581</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>2147483648</filesize>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>

View file

@ -0,0 +1,10 @@
name = Update test admin theme
description = Test theme which is used as admin theme.
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2017-06-21
version = "7.56"
project = "drupal"
datestamp = "1498069849"

View file

@ -0,0 +1,10 @@
name = Update test base theme
description = Test theme which acts as a base theme for other test subthemes.
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2017-06-21
version = "7.56"
project = "drupal"
datestamp = "1498069849"

View file

@ -0,0 +1,11 @@
name = Update test subtheme
description = Test theme which uses update_test_basetheme as the base theme.
core = 7.x
base theme = update_test_basetheme
hidden = TRUE
; Information added by Drupal.org packaging script on 2017-06-21
version = "7.56"
project = "drupal"
datestamp = "1498069849"

View file

@ -0,0 +1,12 @@
name = Update test
description = Support module for update module testing.
package = Testing
version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2017-06-21
version = "7.56"
project = "drupal"
datestamp = "1498069849"

View file

@ -0,0 +1,192 @@
<?php
/**
* @file
* Module for testing Update Manager functionality.
*/
/**
* Implements hook_system_theme_info().
*/
function update_test_system_theme_info() {
$themes['update_test_basetheme'] = drupal_get_path('module', 'update_test') . '/themes/update_test_basetheme/update_test_basetheme.info';
$themes['update_test_subtheme'] = drupal_get_path('module', 'update_test') . '/themes/update_test_subtheme/update_test_subtheme.info';
$themes['update_test_admintheme'] = drupal_get_path('module', 'update_test') . '/themes/update_test_admintheme/update_test_admintheme.info';
return $themes;
}
/**
* Implements hook_menu().
*/
function update_test_menu() {
$items = array();
$items['update-test'] = array(
'title' => t('Update test'),
'page callback' => 'update_test_mock_page',
'access callback' => TRUE,
'type' => MENU_CALLBACK,
);
$items['503-error'] = array(
'title' => t('503 Service unavailable'),
'page callback' => 'update_callback_service_unavailable',
'access callback' => TRUE,
'type' => MENU_CALLBACK,
);
return $items;
}
/**
* Implements hook_system_info_alter().
*
* Checks the 'update_test_system_info' variable and sees if we need to alter
* the system info for the given $file based on the setting. The setting is
* expected to be a nested associative array. If the key '#all' is defined, its
* subarray will include .info keys and values for all modules and themes on the
* system. Otherwise, the settings array is keyed by the module or theme short
* name ($file->name) and the subarrays contain settings just for that module or
* theme.
*/
function update_test_system_info_alter(&$info, $file) {
$setting = variable_get('update_test_system_info', array());
foreach (array('#all', $file->name) as $id) {
if (!empty($setting[$id])) {
foreach ($setting[$id] as $key => $value) {
$info[$key] = $value;
}
}
}
}
/**
* Implements hook_update_status_alter().
*
* Checks the 'update_test_update_status' variable and sees if we need to alter
* the update status for the given project based on the setting. The setting is
* expected to be a nested associative array. If the key '#all' is defined, its
* subarray will include .info keys and values for all modules and themes on the
* system. Otherwise, the settings array is keyed by the module or theme short
* name and the subarrays contain settings just for that module or theme.
*/
function update_test_update_status_alter(&$projects) {
$setting = variable_get('update_test_update_status', array());
if (!empty($setting)) {
foreach ($projects as $project_name => &$project) {
foreach (array('#all', $project_name) as $id) {
if (!empty($setting[$id])) {
foreach ($setting[$id] as $key => $value) {
$project[$key] = $value;
}
}
}
}
}
}
/**
* Page callback: Prints mock XML for the Update Manager module.
*
* The specific XML file to print depends on two things: the project we're
* trying to fetch data for, and the desired "availability scenario" for that
* project which we're trying to test. Before attempting to fetch this data (by
* checking for updates on the available updates report), callers need to define
* the 'update_test_xml_map' variable as an array, keyed by project name,
* indicating which availability scenario to use for that project.
*
* @param $project_name
* The project short name the update manager is trying to fetch data for (the
* fetch URLs are of the form: [base_url]/[project_name]/[core_version]).
*
* @see update_test_menu()
*/
function update_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', 'update_test');
readfile("$path/$project_name.$availability_scenario.xml");
}
/**
* Implements hook_archiver_info().
*/
function update_test_archiver_info() {
return array(
'update_test_archiver' => array(
// This is bogus, we only care about the extensions for now.
'class' => 'ArchiverUpdateTest',
'extensions' => array('update-test-extension'),
),
);
}
/**
* Implements hook_filetransfer_info().
*/
function update_test_filetransfer_info() {
// Define a mock file transfer method, to ensure that there will always be
// at least one method available in the user interface (regardless of the
// environment in which the update manager tests are run).
return array(
'system_test' => array(
'title' => t('Update Test FileTransfer'),
// This should be in an .inc file, but for testing purposes, it is OK to
// leave it in the main module file.
'file' => 'update_test.module',
'class' => 'UpdateTestFileTransfer',
'weight' => -20,
),
);
}
/**
* Mocks a FileTransfer object to test the settings form functionality.
*/
class UpdateTestFileTransfer {
/**
* Returns an UpdateTestFileTransfer object.
*
* @return
* A new UpdateTestFileTransfer object.
*/
public static function factory() {
return new UpdateTestFileTransfer;
}
/**
* Returns a settings form with a text field to input a username.
*/
public function getSettingsForm() {
$form = array();
$form['udpate_test_username'] = array(
'#type' => 'textfield',
'#title' => t('Update Test Username'),
);
return $form;
}
}
/**
* Page callback: Displays an Error 503 (Service unavailable) page.
*
* @see update_test_menu()
*/
function update_callback_service_unavailable() {
drupal_add_http_header('Status', '503 Service unavailable');
print "503 Service Temporarily Unavailable";
}

View file

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Update test base theme</title>
<short_name>update_test_basetheme</short_name>
<dc:creator>Drupal</dc:creator>
<api_version>7.x</api_version>
<recommended_major>1</recommended_major>
<supported_majors>1</supported_majors>
<default_major>1</default_major>
<project_status>published</project_status>
<link>http://example.com/project/update_test_basetheme</link>
<terms>
<term><name>Projects</name><value>Themes</value></term>
</terms>
<releases>
<release>
<name>update_test_basetheme 7.x-1.1</name>
<version>7.x-1.1</version>
<tag>DRUPAL-7--1-1</tag>
<version_major>1</version_major>
<version_patch>1</version_patch>
<status>published</status>
<release_link>http://example.com/update_test_basetheme-7-x-1-1-release</release_link>
<download_link>http://example.com/update_test_basetheme-7.x-1.1.tar.gz</download_link>
<date>1250624521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073763241</filesize>
<terms>
<term><name>Release type</name><value>Security update</value></term>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>update_test_basetheme 7.x-1.0</name>
<version>7.x-1.0</version>
<tag>DRUPAL-7--1-0</tag>
<version_major>1</version_major>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/update_test_basetheme-7-x-1-0-release</release_link>
<download_link>http://example.com/update_test_basetheme-7.x-1.0.tar.gz</download_link>
<date>1250524521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Update test subtheme</title>
<short_name>update_test_subtheme</short_name>
<dc:creator>Drupal</dc:creator>
<api_version>7.x</api_version>
<recommended_major>1</recommended_major>
<supported_majors>1</supported_majors>
<default_major>1</default_major>
<project_status>published</project_status>
<link>http://example.com/project/update_test_subtheme</link>
<terms>
<term><name>Projects</name><value>Themes</value></term>
</terms>
<releases>
<release>
<name>update_test_subtheme 7.x-1.0</name>
<version>7.x-1.0</version>
<tag>DRUPAL-7--1-0</tag>
<version_major>1</version_major>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/update_test_subtheme-7-x-1-0-release</release_link>
<download_link>http://example.com/update_test_subtheme-7.x-1.0.tar.gz</download_link>
<date>1250524521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>