You are here

public function FileEntityTypeTest::testCreate in File Entity (fieldable files) 8.2

Test creating a new type. Basic CRUD.

File

tests/src/Functional/FileEntityTypeTest.php, line 40

Class

FileEntityTypeTest
Tests the file entity types.

Namespace

Drupal\Tests\file_entity\Functional

Code

public function testCreate() {
  $type_machine_type = 'foo';
  $type_machine_label = 'foobar';
  $this
    ->createFileType(array(
    'id' => $type_machine_type,
    'label' => $type_machine_label,
  ));
  $loaded_type = FileType::load($type_machine_type);
  $this
    ->assertEqual($loaded_type
    ->label(), $type_machine_label, "Was able to create a type and retreive it.");
}