function UserRegistrationResourceTest::testEmptyPost

Same name in other branches
  1. 9 core/modules/user/tests/src/Unit/UserRegistrationResourceTest.php \Drupal\Tests\user\Unit\UserRegistrationResourceTest::testEmptyPost()
  2. 8.9.x core/modules/user/tests/src/Unit/UserRegistrationResourceTest.php \Drupal\Tests\user\Unit\UserRegistrationResourceTest::testEmptyPost()
  3. 10 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 91

Class

UserRegistrationResourceTest
Tests User Registration REST resource.

Namespace

Drupal\Tests\user\Unit

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.