function UserRegistrationResourceTest::testExistedEntityPost
Same name in other branches
- 9 core/modules/user/tests/src/Unit/UserRegistrationResourceTest.php \Drupal\Tests\user\Unit\UserRegistrationResourceTest::testExistedEntityPost()
- 8.9.x core/modules/user/tests/src/Unit/UserRegistrationResourceTest.php \Drupal\Tests\user\Unit\UserRegistrationResourceTest::testExistedEntityPost()
- 11.x core/modules/user/tests/src/Unit/UserRegistrationResourceTest.php \Drupal\Tests\user\Unit\UserRegistrationResourceTest::testExistedEntityPost()
Tests that only new user accounts can be registered.
File
-
core/
modules/ user/ tests/ src/ Unit/ UserRegistrationResourceTest.php, line 100
Class
- UserRegistrationResourceTest
- Tests User Registration REST resource.
Namespace
Drupal\Tests\user\UnitCode
public function testExistedEntityPost() : void {
$entity = $this->prophesize(User::class);
$entity->isNew()
->willReturn(FALSE);
$this->expectException(BadRequestHttpException::class);
$this->testClass
->post($entity->reveal());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.