public function FileEntityNormalizerTest::setUp in File Entity (fieldable files) 8.2
Overrides KernelTestBase::setUp
File
- tests/
src/ Kernel/ FileEntityNormalizerTest.php, line 47
Class
- FileEntityNormalizerTest
- Tests the File entity normalizer.
Namespace
Drupal\Tests\file_entity\KernelCode
public function setUp() {
parent::setUp();
$this
->installEntitySchema('node');
$this
->installEntitySchema('file');
$this
->installEntitySchema('user');
$this
->installSchema('file', array(
'file_usage',
));
$this
->installSchema('file_entity', array(
'file_metadata',
));
// Set the file route to provide entity URI for serialization.
$route_collection = new RouteCollection();
$route_collection
->add('entity.file.canonical', new Route('file/{file}'));
$this->container
->set('router.route_provider', new MockRouteProvider($route_collection));
}