private function PageContextTest::getTerm in Acquia Lift Connector 8
Get Term.
Parameters
string $name:
string $vocabulary_id:
Return value
Drupal\taxonomy\TermInterface|\PHPUnit_Framework_MockObject_MockObject
1 call to PageContextTest::getTerm()
- PageContextTest::testGetAllWithSetByNodeSetUpFields in tests/
src/ Unit/ Service/ Context/ PageContextTest.php - testGetAllWithSetByNode(), sub routine "setup fields".
File
- tests/
src/ Unit/ Service/ Context/ PageContextTest.php, line 300 - Contains \Drupal\Tests\acquia_lift\Service\Context\PageContextTest.
Class
- PageContextTest
- PageContextTest Test.
Namespace
Drupal\Tests\acquia_lift\Service\ContextCode
private function getTerm($name = 'Term Name', $vocabulary_id = 'untracked_vocabulary_id') {
$term = $this
->getMock('Drupal\\taxonomy\\TermInterface');
$term
->expects($this
->once())
->method('getVocabularyId')
->willReturn($vocabulary_id);
$term
->expects($this
->once())
->method('getName')
->willReturn($name);
return $term;
}