Skip to content
Snippets Groups Projects
Commit 6a28e4bd authored by omkar podey's avatar omkar podey Committed by Adam G-H
Browse files

Issue #3293148 by kunal.sachdev, omkar.podey: Clean up or remove PackageUpdateTest

parent 603cfb23
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 337 deletions
<?php
namespace Drupal\updated_module;
/**
* This class will have a different value in updated_module 1.1.0.
*/
class ChangedClass {
/**
* The value.
*
* @var string
*/
public static $value = 'Before Update';
}
<?php
namespace Drupal\updated_module;
/**
* This class is removed from updated_module 1.1.0.
*/
class DeletedClass {
/**
* The value.
*
* @var string
*/
public static $value = 'This class will be deleted';
}
<?php
namespace Drupal\updated_module;
/**
* This class is loaded in updated_module 1.0.0 and removed in 1.1.0.
*/
class LoadedAndDeletedClass {
/**
* The value.
*
* @var string
*/
public static $value = 'This class will be loaded and then deleted';
}
<?php
namespace Drupal\updated_module\Plugin\Block;
use Drupal\Core\Block\BlockBase;
/**
* This block is removed from version 1.1.0 of this module.
*
* @Block(
* id = "updated_module_deleted_block",
* admin_label = @Translation("Deleted block"),
* )
*/
class DeletedBlock extends BlockBase {
/**
* {@inheritdoc}
*/
public function build() {
return [
'#markup' => $this->t('Goodbye!'),
];
}
}
<?php
namespace Drupal\updated_module\Plugin\Block;
use Drupal\Core\Block\BlockBase;
/**
* Defines a block plugin to test plugin reloading during an update.
*
* This block should NOT be loaded before updating to version 1.1.0 of this
* module.
*
* @Block(
* id = "updated_module_ignored_block",
* admin_label = @Translation("1.0.0")
* )
*/
class IgnoredBlock extends BlockBase {
/**
* {@inheritdoc}
*/
public function build() {
return [
'#markup' => $this->t("I should not be instantiated before the update."),
];
}
}
<?php
namespace Drupal\updated_module\Plugin\Block;
use Drupal\Core\Block\BlockBase;
/**
* Defines a block plugin to test plugin reloading during an update.
*
* In version 1.1.0 of this module, this block exists but its plugin definition
* and implementation are different.
*
* @Block(
* id = "updated_module_updated_block",
* admin_label = @Translation("1.0.0")
* )
*/
class UpdatedBlock extends BlockBase {
/**
* {@inheritdoc}
*/
public function build() {
return [
'#markup' => $this->t('1.0.0'),
];
}
}
......@@ -16,12 +16,3 @@ function updated_module_hello(): array {
'#markup' => 'Hello!',
];
}
/**
* A test function to test if global functions are reloaded during an update.
*
* @return string
*/
function _updated_module_global1(): string {
return "pre-update-value";
}
changed permission:
title: 'permission'
deleted permission:
title: 'deleted permission'
updated_module.changed:
path: '/updated-module/changed/pre'
defaults:
_controller: 'updated_module_hello'
requirements:
_access: 'TRUE'
updated_module.deleted:
path: '/updated-module/deleted'
defaults:
_controller: 'updated_module_hello'
requirements:
_access: 'TRUE'
services:
updated_module.existing_service:
class: stdClass
properties:
value: 'Pre-update value'
updated_module.deleted_service:
class: stdClass
properties:
value: 'Deleted service, should not exist after update'
<?php
namespace Drupal\updated_module;
/**
* This class only exists in updated_module 1.1.0.
*/
class AddedClass {
/**
* The value.
*
* @var string
*/
public static $value = 'This class will be added';
}
<?php
namespace Drupal\updated_module;
/**
* This class exists in updated_module 1.0.0, but with a different value.
*/
class ChangedClass {
/**
* The value.
*
* @var string
*/
public static $value = 'After Update';
}
<?php
namespace Drupal\updated_module\Plugin\Block;
use Drupal\Core\Block\BlockBase;
/**
* This block doesn't exist in version 1.0.0 of this module.
*
* @Block(
* id = "updated_module_added_block",
* admin_label = @Translation("Added block"),
* )
*/
class AddedBlock extends BlockBase {
/**
* {@inheritdoc}
*/
public function build() {
return [
'#markup' => $this->t('Hello!'),
];
}
}
<?php
namespace Drupal\updated_module\Plugin\Block;
use Drupal\Core\Block\BlockBase;
/**
* Defines a block plugin to test plugin reloading during an update.
*
* This block should only be loaded and built after updating to version 1.1.0 of
* this module.
*
* @Block(
* id = "updated_module_ignored_block",
* admin_label = @Translation("1.1.0")
* )
*/
class IgnoredBlock extends BlockBase {
/**
* {@inheritdoc}
*/
public function build() {
return [
'#markup' => $this->t('I was ignored before the update.'),
];
}
}
<?php
namespace Drupal\updated_module\Plugin\Block;
use Drupal\Core\Block\BlockBase;
/**
* Defines a block plugin to test plugin reloading during an update.
*
* In version 1.0.0 of this module, this block exists but its plugin definition
* and implementation are different.
*
* @Block(
* id = "updated_module_updated_block",
* admin_label = @Translation("1.1.0")
* )
*/
class UpdatedBlock extends BlockBase {
/**
* {@inheritdoc}
*/
public function build() {
return [
'#markup' => $this->t('1.1.0'),
];
}
}
......@@ -16,18 +16,3 @@ function updated_module_hello(): array {
'#markup' => 'Hello!',
];
}
/**
* A test function to test if global functions are reloaded during an update.
*
* @return string
*/
function _updated_module_global1(): string {
return "post-update-value";
}
/**
* A test function to test if a new global function will be available after an update.
*/
function _updated_module_global2(): void {
}
changed permission:
title: 'changed permission'
added permission:
title: 'added permission'
updated_module.changed:
path: '/updated-module/changed/post'
defaults:
_controller: 'updated_module_hello'
requirements:
_access: 'TRUE'
updated_module.added:
path: '/updated-module/added'
defaults:
_controller: 'updated_module_hello'
requirements:
_access: 'TRUE'
services:
updated_module.existing_service:
class: stdClass
properties:
value: 'Post-update value'
updated_module.added_service:
class: stdClass
properties:
value: 'New service, should not exist before update'
updated_module.post_apply_subscriber:
class: Drupal\updated_module\PostApplySubscriber
arguments:
......
services:
package_manager_test_api.system_change_recorder:
class: Drupal\package_manager_test_api\SystemChangeRecorder
arguments:
- '@package_manager.path_locator'
- '@state'
- '@router.no_access_checks'
- '@user.permissions'
- '@plugin.manager.block'
tags:
- { name: event_subscriber }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment