private function PageContextTest::getTerm in Acquia Lift Connector 8.4
Same name and namespace in other branches
- 8.3 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 471
Class
- PageContextTest
- PageContextTest Test.
Namespace
Drupal\Tests\acquia_lift\Unit\Service\ContextCode
private function getTerm($name = 'Term Name', $vocabulary_id = 'untracked_vocabulary_id') {
$term = $this
->createMock('Drupal\\taxonomy\\TermInterface');
$term
->expects($this
->once())
->method('bundle')
->willReturn($vocabulary_id);
$term
->expects($this
->once())
->method('getName')
->willReturn($name);
return $term;
}