You are here

protected function TaxonomyViewsIntegratorTestBase::createTaxonomyViewsIntegratorConfiguration in Taxonomy Views Integrator 8

Generate TVI configuration for the created vocab and terms.

1 call to TaxonomyViewsIntegratorTestBase::createTaxonomyViewsIntegratorConfiguration()
TaxonomyViewsIntegratorTestBase::setUp in tests/src/Functional/TaxonomyViewsIntegratorTestBase.php

File

tests/src/Functional/TaxonomyViewsIntegratorTestBase.php, line 288

Class

TaxonomyViewsIntegratorTestBase
TVI PHPUnit Test base.

Namespace

Drupal\Tests\tvi\Functional

Code

protected function createTaxonomyViewsIntegratorConfiguration() {

  // Set global default
  // Set vocabulary1 config.
  $this
    ->config('tvi.taxonomy_vocabulary.' . $this->vocabulary1
    ->id())
    ->set('enable_override', 1)
    ->set('view', 'tvi_page')
    ->set('view_display', 'page_1')
    ->set('inherit_settings', 1)
    ->save();

  // Set vocabulary2 config.
  $this
    ->config('tvi.taxonomy_vocabulary.' . $this->vocabulary2
    ->id())
    ->set('enable_override', 0)
    ->save();

  // Term 1.
  $this
    ->config('tvi.taxonomy_term.' . $this->term1
    ->id())
    ->set('enable_override', 1)
    ->set('view', 'tvi_page')
    ->set('view_display', 'page_1')
    ->set('inherit_settings', 0)
    ->save();

  // Term 2.
  $this
    ->config('tvi.taxonomy_term.' . $this->term2
    ->id())
    ->set('enable_override', 1)
    ->set('view', 'tvi_page')
    ->set('view_display', 'page_2')
    ->set('inherit_settings', 1)
    ->save();

  // Term 3.
  $this
    ->config('tvi.taxonomy_term.' . $this->term3
    ->id())
    ->set('enable_override', 0)
    ->save();

  // Term 4.
  $this
    ->config('tvi.taxonomy_term.' . $this->term4
    ->id())
    ->set('enable_override', 0)
    ->save();

  // Term 5.
  $this
    ->config('tvi.taxonomy_term.' . $this->term5
    ->id())
    ->set('enable_override', 1)
    ->set('view', 'tvi_page')
    ->set('view_display', 'page_1')
    ->set('inherit_settings', 0)
    ->save();

  // Term 6.
  $this
    ->config('tvi.taxonomy_term.' . $this->term6
    ->id())
    ->set('enable_override', 0)
    ->save();

  // Term 7.
  $this
    ->config('tvi.taxonomy_term.' . $this->term7
    ->id())
    ->set('enable_override', 0)
    ->save();

  // Term 8.
  $this
    ->config('tvi.taxonomy_term.' . $this->term8
    ->id())
    ->set('enable_override', 1)
    ->set('view', 'tvi_page')
    ->set('view_display', 'page_1')
    ->set('inherit_settings', 0)
    ->save();

  // Term 9.
  $this
    ->config('tvi.taxonomy_term.' . $this->term9
    ->id())
    ->set('enable_override', 0)
    ->save();

  // Term 10.
  $this
    ->config('tvi.taxonomy_term.' . $this->term10
    ->id())
    ->set('enable_override', 1)
    ->set('view', 'tvi_page')
    ->set('view_display', 'page_2')
    ->set('inherit_settings', 1)
    ->save();

  // Term 11.
  $this
    ->config('tvi.taxonomy_term.' . $this->term11
    ->id())
    ->set('enable_override', 0)
    ->save();

  // Term 12.
  $this
    ->config('tvi.taxonomy_term.' . $this->term12
    ->id())
    ->set('enable_override', 1)
    ->set('view', 'tvi_page')
    ->set('view_display', 'page_1')
    ->set('inherit_settings', 0)
    ->save();
  $this
    ->refreshVariables();
}