diff --git a/tests/src/Functional/YourExtensionFunctionalTest.php b/tests/src/Functional/YourExtensionFunctionalTest.php index 26e15915..648684e3 100644 --- a/tests/src/Functional/YourExtensionFunctionalTest.php +++ b/tests/src/Functional/YourExtensionFunctionalTest.php @@ -4,6 +4,7 @@ namespace Drupal\Tests\your_extension\Functional; +use Drupal\Core\Session\AccountInterface; use Drupal\Tests\BrowserTestBase; /** @@ -30,6 +31,9 @@ class YourExtensionFunctionalTest extends BrowserTestBase { */ public function testGetText() { $user = $this->createUser(['administer site configuration']); + if (!$user instanceof AccountInterface) { + throw new \Exception('User could not be created.'); + } $this->drupalLogin($user); $this->drupalGet('admin/config/development/your-extension');