You are here

private function PageContextTest::populateHtmlHeadWithNodeAndFieldsSetUpFields in Acquia Lift Connector 8.3

Same name and namespace in other branches
  1. 8.4 tests/src/Unit/Service/Context/PageContextTest.php \Drupal\Tests\acquia_lift\Unit\Service\Context\PageContextTest::populateHtmlHeadWithNodeAndFieldsSetUpFields()

testPopulateHtmlHeadWithNodeAndFields(), sub routine "setup fields".

1 call to PageContextTest::populateHtmlHeadWithNodeAndFieldsSetUpFields()
PageContextTest::testPopulateHtmlHeadWithNodeAndFields in tests/src/Unit/Service/Context/PageContextTest.php
Tests the populate() method, populateHtmlHead() sub method, with a Node and fields.

File

tests/src/Unit/Service/Context/PageContextTest.php, line 548

Class

PageContextTest
PageContextTest Test.

Namespace

Drupal\Tests\acquia_lift\Unit\Service\Context

Code

private function populateHtmlHeadWithNodeAndFieldsSetUpFields() {
  $tracked_content_term_1 = $this
    ->getTerm('Tracked Content Term Name 1', 'tracked_content_vocabulary');
  $tracked_keyword_term_1 = $this
    ->getTerm('Tracked Keyword Term Name 1', 'tracked_keyword_vocabulary');
  $tracked_keyword_term_2 = $this
    ->getTerm('Tracked Keyword Term Name 2', 'tracked_keyword_vocabulary');
  $discarded_term_1 = $this
    ->getTerm('Untracked Term Name', 'untracked_vocabulary_id');
  $terms = [
    90210 => [
      $tracked_content_term_1,
      $tracked_keyword_term_1,
      $tracked_keyword_term_2,
      $discarded_term_1,
    ],
  ];
  $this->taxonomyTermStorage
    ->expects($this
    ->once())
    ->method('getNodeTerms')
    ->with([
    90210,
  ])
    ->willReturn($terms);
}