function FileUploadTest::createEntity
Creates the entity to be tested.
Return value
\Drupal\Core\Entity\EntityInterface The entity to be tested.
Overrides ResourceTestBase::createEntity
File
- 
              core/modules/ jsonapi/ tests/ src/ Functional/ FileUploadTest.php, line 191 
Class
- FileUploadTest
- Tests binary data file upload route.
Namespace
Drupal\Tests\jsonapi\FunctionalCode
protected function createEntity() {
  // Create an entity that a file can be attached to.
  $entity_test = EntityTest::create([
    'name' => 'Llama',
    'type' => 'entity_test',
  ]);
  $entity_test->setOwnerId($this->account
    ->id());
  $entity_test->save();
  return $entity_test;
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
