function FileTest::createAnotherEntity
Same name in other branches
- 8.9.x core/modules/jsonapi/tests/src/Functional/FileTest.php \Drupal\Tests\jsonapi\Functional\FileTest::createAnotherEntity()
- 10 core/modules/jsonapi/tests/src/Functional/FileTest.php \Drupal\Tests\jsonapi\Functional\FileTest::createAnotherEntity()
- 11.x core/modules/jsonapi/tests/src/Functional/FileTest.php \Drupal\Tests\jsonapi\Functional\FileTest::createAnotherEntity()
Overrides ResourceTestBase::createAnotherEntity
File
-
core/
modules/ jsonapi/ tests/ src/ Functional/ FileTest.php, line 120
Class
- FileTest
- JSON:API integration test for the "File" content entity type.
Namespace
Drupal\Tests\jsonapi\FunctionalCode
protected function createAnotherEntity($key) {
/** @var \Drupal\file\FileInterface $duplicate */
$duplicate = parent::createAnotherEntity($key);
$duplicate->setFileUri("public://{$key}.txt");
$duplicate->save();
return $duplicate;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.