Skip to content
Snippets Groups Projects
Commit 3050fa44 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3340024 by alexpott: Fix test fails on Drupal 9.5 / PHP 7.4

parent 5e841757
No related branches found
No related tags found
1 merge request!13Resolve #3340024 "Fix test fails"
......@@ -158,7 +158,7 @@ class RegistrationNotification extends JobTypeBase implements ContainerFactoryPl
$retry = strlen($error_code) > 2;
}
}
else {
elseif ($error_message !== '') {
$dom = new \DOMDocument();
if (@$dom->loadHTML($error_message)) {
$error_message = Html::serialize($dom);
......
......@@ -6,6 +6,7 @@
*/
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider;
/**
* Implements hook_vgwort_enable_for_entity().
......@@ -13,3 +14,19 @@ use Drupal\Core\Entity\EntityInterface;
function vgwort_test_vgwort_enable_for_entity(EntityInterface $entity): bool {
return !in_array($entity->id(), \Drupal::state()->get('vgwort_test_vgwort_enable_for_entity', []), TRUE);
}
/**
* Implements hook_entity_type_alter().
*/
function vgwort_test_entity_type_alter(array &$entity_types) {
// @todo Remove once minimum support Drupal version is greater or equal to
// 10.1. This is fixed by https://drupal.org/i/2350939.
if (!empty($entity_types['entity_test_revpub'])) {
$route_providers = $entity_types['entity_test_revpub']->getRouteProviderClasses();
if (!isset($route_providers['html'])) {
$route_providers['html'] = DefaultHtmlRouteProvider::class;
$entity_types['entity_test_revpub']->setHandlerClass('route_provider', $route_providers);
$entity_types['entity_test_revpub']->setLinkTemplate('canonical', '/entity_test_revpub/manage/{entity_test_revpub}');
}
}
}
......@@ -29,6 +29,14 @@ class EntityQueueTest extends VgWortKernelTestBase {
*/
private $handler;
/**
* {@inheritdoc}
*
* @todo Remove once minimum support Drupal version is greater or equal to
* 10.1. This is fixed by https://drupal.org/i/2350939.
*/
protected static $modules = ['vgwort_test'];
/**
* History of requests/responses.
*
......@@ -169,7 +177,7 @@ class EntityQueueTest extends VgWortKernelTestBase {
$this->assertSame($jobs, $queue_backend->countJobs());
$this->handler->append(new Response());
$this->handler->append(new Response(500));
$this->handler->append(new Response(500, ['Content-Type' => ['application/json', 'charset=UTF-8']], '{"message":{"errorcode":1,"errormsg":"Privater Identifikationscode: Für den eingegebenen Wert existiert keine Zählmarke."}}'));
$this->container->get('advancedqueue.processor')->processQueue($queue);
$jobs = self::JOB_COUNT;
......
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