- Issue created by @rhovland
- Status changed to RTBC
3 months ago 10:10pm 30 August 2024 - Status changed to Fixed
3 months ago 7:01am 2 September 2024 Automatically closed - issue fixed for 2 weeks with no activity.
In the tests run with Drupal 11 and Commerce 3 the test fails due to these lines in Kernel\AcceptJsPaymentMethodTest.php
$user = $this->createUser(['mail' => $this->randomString() . '@example.com']);
The function createUser() expects permissions to be the first argument
The correct syntax is
$user = $this->createUser([], NULL, FALSE, [
'mail' => 'customer@example.com',
'preferred_langcode' => 'en',
]);
It looks like passing values as the first parameter is depreciated in D11
https://www.drupal.org/node/3330762 →
/**
* Creates a user.
*
* @param array $permissions
* Array of permission names to assign to user. Note that the user always
* has the default permissions derived from the "authenticated users" role.
* @param string $name
* The user name.
* @param bool $admin
* (optional) Whether the user should be an administrator
* with all the available permissions.
* @param array $values
* (optional) An array of initial user field values.
*
* @return \Drupal\user\Entity\User
* The created user entity.
*/
protected function createUser(array $permissions = [], $name = NULL, bool $admin = FALSE, array $values = []) {
return $this->drupalCreateUser($permissions, $name, $admin, $values);
}
Fixed
1.0
Code
Automatically closed - issue fixed for 2 weeks with no activity.