You are here

private function PageContextTest::getTerm 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::getTerm()

Get Term.

Parameters

string $name:

string $vocabulary_id:

Return value

Drupal\taxonomy\TermInterface|\PHPUnit_Framework_MockObject_MockObject

1 call to PageContextTest::getTerm()
PageContextTest::populateHtmlHeadWithNodeAndFieldsSetUpFields in tests/src/Unit/Service/Context/PageContextTest.php
testPopulateHtmlHeadWithNodeAndFields(), sub routine "setup fields".

File

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

Class

PageContextTest
PageContextTest Test.

Namespace

Drupal\Tests\acquia_lift\Unit\Service\Context

Code

private function getTerm($name = 'Term Name', $vocabulary_id = 'untracked_vocabulary_id') {
  $term = $this
    ->getMock('Drupal\\taxonomy\\TermInterface');
  $term
    ->expects($this
    ->once())
    ->method('bundle')
    ->willReturn($vocabulary_id);
  $term
    ->expects($this
    ->once())
    ->method('getName')
    ->willReturn($name);
  return $term;
}