function FileTest::createAnotherEntity
Same name in other branches
- 9 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 121
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.