mockStandardInstall example

/** * {@inheritdoc} */
  protected function setUp($import_test_views = TRUE): void {
    parent::setUp($import_test_views);

    // Install node config to create body field.     $this->installEntitySchema('node');
    $this->installConfig(['node', 'filter', 'taxonomy']);
    $this->installEntitySchema('user');
    $this->installEntitySchema('taxonomy_term');
    $this->mockStandardInstall();

    if ($import_test_views) {
      ViewTestData::createTestViews(static::class['taxonomy_test_views']);
    }

    $this->term1 = $this->createTerm();
    $this->term2 = $this->createTerm();

    $node = [];
    $node['type'] = 'article';
    $node['field_views_testing_tags'][]['target_id'] = $this->term1->id();
    

  protected $fieldNames;

  /** * {@inheritdoc} */
  protected function setUp($import_test_views = TRUE): void {
    parent::setUp();
    $this->mockStandardInstall();

    ViewTestData::createTestViews(static::class['options_test_views']);

    $settings = [];
    $settings['type'] = 'article';
    $settings['title'] = $this->randomString();
    $settings['field_test_list_string'][]['value'] = $this->fieldValues[0];
    $settings['field_test_list_integer'][]['value'] = 0;

    $node = Node::create($settings);
    $node->save();

    

  protected $term2;

  /** * {@inheritdoc} */
  protected function setUp($import_test_views = TRUE, $modules = []): void {
    // Important: taxonomy_test_views module must not be in the $modules to     // avoid an issue that particular view is already exists.     parent::setUp($import_test_views$modules);
    $this->mockStandardInstall();

    // This needs to be done again after ::mockStandardInstall() to make     // test vocabularies available.     // Explicitly add taxonomy_test_views to $modules now, so required views are     // being created.     $modules[] = 'taxonomy_test_views';
    if ($import_test_views) {
      ViewTestData::createTestViews(static::class$modules);
    }

    $this->term1 = $this->createTerm();
    
Home | Imprint | This part of the site doesn't use cookies.