diff core/modules/user/tests/src/Unit/UserRegistrationResourceTest.php @ 18:af1871eacc83

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:33:08 +0100
parents 4c8ae668cc8c
children
line wrap: on
line diff
--- a/core/modules/user/tests/src/Unit/UserRegistrationResourceTest.php	Thu Feb 28 13:21:36 2019 +0000
+++ b/core/modules/user/tests/src/Unit/UserRegistrationResourceTest.php	Thu May 09 15:33:08 2019 +0100
@@ -7,33 +7,12 @@
 use Drupal\Tests\UnitTestCase;
 use Drupal\user\Entity\User;
 use Drupal\user\Plugin\rest\resource\UserRegistrationResource;
+use Drupal\user\UserInterface;
 use Psr\Log\LoggerInterface;
 use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
 use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
 
 /**
- * Only administrators can create user accounts.
- */
-if (!defined('USER_REGISTER_ADMINISTRATORS_ONLY')) {
-  define('USER_REGISTER_ADMINISTRATORS_ONLY', 'admin_only');
-}
-
-/**
- * Visitors can create their own accounts.
- */
-if (!defined('USER_REGISTER_VISITORS')) {
-  define('USER_REGISTER_VISITORS', 'visitors');
-}
-
-/**
- * Visitors can create accounts, but they don't become active without
- * administrative approval.
- */
-if (!defined('USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL')) {
-  define('USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL', 'visitors_admin_approval');
-}
-
-/**
  * Tests User Registration REST resource.
  *
  * @coversDefaultClass \Drupal\user\Plugin\rest\resource\UserRegistrationResource
@@ -118,7 +97,7 @@
    */
   public function testRegistrationAdminOnlyPost() {
 
-    $this->userSettings->get('register')->willReturn(USER_REGISTER_ADMINISTRATORS_ONLY);
+    $this->userSettings->get('register')->willReturn(UserInterface::REGISTER_ADMINISTRATORS_ONLY);
 
     $this->currentUser->isAnonymous()->willReturn(TRUE);