Skip to content
Snippets Groups Projects
Commit 64fab281 authored by john.oltman's avatar john.oltman
Browse files

Issue #3472901: Upgrade to Commerce 3.0.x

parent d2f51333
No related branches found
Tags 8.x-1.21
1 merge request!20Issue #3472901: Upgrade to Commerce 3.0.x
Pipeline #277393 passed
Showing
with 18 additions and 29 deletions
......@@ -47,7 +47,8 @@ include:
# Docs at https://git.drupalcode.org/project/gitlab_templates/-/blob/1.0.x/includes/include.drupalci.variables.yml
################
variables:
OPT_IN_TEST_NEXT_MAJOR: '0'
OPT_IN_TEST_NEXT_MAJOR: 1
OPT_IN_TEST_NEXT_MINOR: 1
###################################################################################
......
......@@ -2,8 +2,7 @@ name: Commerce Registration
type: module
description: 'Provides registration integration for Drupal Commerce.'
package: 'Commerce (contrib)'
core_version_requirement: ^9.3 || ^10
php: 8.0
core_version_requirement: ^10.3 || ^11
dependencies:
- commerce:commerce
- commerce:commerce_cart
......
......@@ -12,9 +12,8 @@
}
],
"require": {
"php": "^8.0",
"drupal/commerce": "^2.0",
"drupal/registration": "^3.0"
"drupal/commerce": "^3.0",
"drupal/registration": "^3.3"
},
"support": {
"issues": "https://www.drupal.org/project/issues/commerce_registration",
......
......@@ -505,7 +505,6 @@ display:
default_argument_type: fixed
default_argument_options:
argument: ''
default_argument_skip_url: false
summary_options:
base_path: ''
count: true
......
......@@ -709,7 +709,6 @@ display:
title: ''
default_argument_type: commerce_registration_product_id
default_argument_options: { }
default_argument_skip_url: false
summary_options:
base_path: ''
count: true
......
......@@ -523,7 +523,6 @@ display:
title: ''
default_argument_type: product
default_argument_options: { }
default_argument_skip_url: false
summary_options:
base_path: ''
count: true
......
......@@ -2,8 +2,7 @@ name: Commerce Registration Wait List
type: module
description: 'Provides integration with the Registration Wait List module.'
package: 'Commerce (contrib)'
core_version_requirement: ^9.3 || ^10
php: 8.0
core_version_requirement: ^10.3 || ^11
dependencies:
- commerce_registration:commerce_registration
- registration:registration_waitlist (>=3.1.2)
- registration:registration_waitlist
......@@ -8,11 +8,11 @@ use Drupal\commerce_order\OrderProcessorInterface;
use Drupal\commerce_price\Resolver\ChainPriceResolverInterface;
use Drupal\commerce_registration_waitlist\Event\CommerceRegistrationWaitListEvent;
use Drupal\commerce_registration_waitlist\Event\CommerceRegistrationWaitListEvents;
use Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Messenger\MessengerTrait;
use Drupal\Core\Session\AccountProxy;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
/**
* Provides an order processor for wait listed registrations.
......@@ -39,9 +39,9 @@ class WaitListOrderProcessor implements OrderProcessorInterface {
/**
* The event dispatcher.
*
* @var \Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher
* @var \Symfony\Contracts\EventDispatcher\EventDispatcherInterface
*/
protected ContainerAwareEventDispatcher $eventDispatcher;
protected EventDispatcherInterface $eventDispatcher;
/**
* The entity type manager.
......@@ -57,12 +57,12 @@ class WaitListOrderProcessor implements OrderProcessorInterface {
* The chain price resolver.
* @param \Drupal\Core\Session\AccountProxy $current_user
* The current user.
* @param \Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher $event_dispatcher
* @param \Symfony\Contracts\EventDispatcher\EventDispatcherInterface $event_dispatcher
* The event dispatcher.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager.
*/
public function __construct(ChainPriceResolverInterface $chain_price_resolver, AccountProxy $current_user, ContainerAwareEventDispatcher $event_dispatcher, EntityTypeManagerInterface $entity_type_manager) {
public function __construct(ChainPriceResolverInterface $chain_price_resolver, AccountProxy $current_user, EventDispatcherInterface $event_dispatcher, EntityTypeManagerInterface $entity_type_manager) {
$this->chainPriceResolver = $chain_price_resolver;
$this->currentUser = $current_user;
$this->eventDispatcher = $event_dispatcher;
......
......@@ -42,15 +42,9 @@ abstract class FormatterTestBase extends CommerceRegistrationKernelTestBase {
* @return string
* The rendered output, with <div> tags removed to make assertions easier.
*/
protected function renderPlain(array $build): string {
if (version_compare(\Drupal::VERSION, '10.3', '>=')) {
$output = trim($this->container->get('renderer')->renderInIsolation($build));
}
else {
// @phpstan-ignore-next-line
$output = trim($this->container->get('renderer')->renderPlain($build));
}
protected function renderField(array $build): string {
$output = trim($this->container->get('renderer')->renderInIsolation($build));
return preg_replace("/<div>(.*?)<\/div>/", "$1", $output);
}
......
......@@ -27,7 +27,7 @@ class RegistrationFormFormatterTest extends FormatterTestBase {
'type' => 'registration_form',
'label' => 'hidden',
]);
$output = $this->renderPlain($build);
$output = $this->renderField($build);
$this->assertStringContainsString('<form class="registration-conference-register-form', $output);
}
......
......@@ -29,7 +29,7 @@ class RegistrationLinkFormatterTest extends FormatterTestBase {
'type' => 'registration_link',
'label' => 'hidden',
]);
$output = $this->renderPlain($build);
$output = $this->renderField($build);
$this->assertEquals('<a href="/product/1/variations/1/register">Conference</a>', $output);
// Custom link label.
......@@ -40,7 +40,7 @@ class RegistrationLinkFormatterTest extends FormatterTestBase {
'label' => 'Register now',
],
]);
$output = $this->renderPlain($build);
$output = $this->renderField($build);
$this->assertEquals('<a href="/product/1/variations/1/register">Register now</a>', $output);
}
......
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