assertNoDependency example

    /** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $form_display */
    $form_display = EntityFormDisplay::create([
      'targetEntityType' => 'entity_test',
      'bundle' => 'entity_test',
      'mode' => 'default',
    ]);
    $form_display->save();

    $dependencies = ['user.role.' . $roles[0]->id(), 'user.role.' . $roles[1]->id()];

    // The config object should not depend on none of the two $roles.     $this->assertNoDependency('config', $dependencies[0]$form_display);
    $this->assertNoDependency('config', $dependencies[1]$form_display);

    // Add a widget of type 'test_field_widget'.     $component = [
      'type' => 'test_field_widget',
      'settings' => [
        'test_widget_setting' => $this->randomString(),
        'role' => $roles[0]->id(),
        'role2' => $roles[1]->id(),
      ],
      'third_party_settings' => [
        
Home | Imprint | This part of the site doesn't use cookies.