Problem/Motivation

As this issue #2737719: EntityResource: Provide comprehensive test coverage: for every entity type, every format, every method has added the test coverage for the User entity with all available formats.

Proposed resolution

Remaining tasks

User interface changes

None.

API changes

None.

Data model changes

None.

Comments

naveenvalecha created an issue. See original summary.

naveenvalecha’s picture

During the conversion of #2870465: Convert web tests to browser tests for user module it looks that there's already the enough test coverage available in the core for the user entity. Does we really needs the \Drupal\user\Tests\RestRegisterUserTest ?

dawehner’s picture

This issue is a bit weird. RestRegisterUserTest tests /user/register, which is a different resource than adding a user via REST. Registering a user is something different.

Wim Leers’s picture

Status: Active » Closed (works as designed)

They're very very different indeed.

  1. \Drupal\Tests\rest\Functional\EntityResource\User\UserResourceTestBase tests \Drupal\rest\Plugin\rest\resource\EntityResource for the \Drupal\user\Entity\User entity type.
  2. \Drupal\user\Tests\RestRegisterUserTest tests \Drupal\user\Plugin\rest\resource\UserRegistrationResource
Wim Leers’s picture

Issue tags: +API-First Initiative
naveenvalecha’s picture

Thanks, Wim!
I asked this because the depreciation notice on the class states to use the EntityResourceTestBase & ResourceTestBase instead and we have the enough EntityResource test coverage for the user entity.

/**
 * Test helper class that provides a REST client method to send HTTP requests.
 *
 * @deprecated in Drupal 8.3.x-dev and will be removed before Drupal 9.0.0. Use \Drupal\Tests\rest\Functional\ResourceTestBase and \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase instead. Only retained for contributed module tests that may be using this base class.
 */
abstract class RESTTestBase extends WebTestBase {

#3,
yup
//Naveen