You are here

public function UserRegistrationResourceTest::testEmptyPost in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/user/tests/src/Unit/UserRegistrationResourceTest.php \Drupal\Tests\user\Unit\UserRegistrationResourceTest::testEmptyPost()
  2. 9 core/modules/user/tests/src/Unit/UserRegistrationResourceTest.php \Drupal\Tests\user\Unit\UserRegistrationResourceTest::testEmptyPost()

Tests that an exception is thrown when no data provided for the account.

File

core/modules/user/tests/src/Unit/UserRegistrationResourceTest.php, line 79

Class

UserRegistrationResourceTest
Tests User Registration REST resource.

Namespace

Drupal\Tests\user\Unit

Code

public function testEmptyPost() {
  $this
    ->expectException(BadRequestHttpException::class);
  $this->testClass
    ->post(NULL);
}