Skip to content
Snippets Groups Projects
Commit 8e327239 authored by Patrick Kenny's avatar Patrick Kenny
Browse files

fix for Drupal 11.2

parent 532bcf2e
No related branches found
No related tags found
1 merge request!27add unit test to confirm core functionality
......@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Drupal\Tests\jsonapi\Functional;
use Drupal\jsonapi_links\Exception\JsonApiLinksException;
use Drupal\user\Entity\User;
/**
* General functional test class.
......@@ -57,18 +58,20 @@ class JsonApiLinksFunctionalTest extends JsonApiFunctionalTestBase {
protected function setUp(): void {
parent::setUp();
$admin_user = $this->drupalCreateUser([
'create article content',
'edit any article content',
'delete any article content',
],
'jsonapi_admin_user',
TRUE,
);
if ($admin_user === FALSE) {
throw new JsonApiLinksException("Failed to create admin user!");
if (!($this->adminUser instanceof User)) {
$admin_user = $this->drupalCreateUser([
'create article content',
'edit any article content',
'delete any article content',
],
'jsonapi_admin_user',
TRUE,
);
if ($admin_user === FALSE) {
throw new JsonApiLinksException("Failed to create admin user!");
}
$this->adminUser = $admin_user;
}
$this->adminUser = $admin_user;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment