public function PageContextTest::setUp in Acquia Lift Connector 8
Overrides UnitTestCase::setUp
File
- tests/
src/ Unit/ Service/ Context/ PageContextTest.php, line 51 - Contains \Drupal\Tests\acquia_lift\Service\Context\PageContextTest.
Class
- PageContextTest
- PageContextTest Test.
Namespace
Drupal\Tests\acquia_lift\Service\ContextCode
public function setUp() {
parent::setUp();
$this->configFactory = $this
->getMock('Drupal\\Core\\Config\\ConfigFactoryInterface');
$this->settings = $this
->getMockBuilder('Drupal\\Core\\Config\\ImmutableConfig')
->disableOriginalConstructor()
->getMock();
$this->entityTypeManager = $this
->getMock('Drupal\\Core\\Entity\\EntityTypeManagerInterface');
$this->taxonomyTermStorage = $this
->getMock('Drupal\\taxonomy\\TermStorageInterface');
$this->configFactory
->expects($this
->once())
->method('get')
->with('acquia_lift.settings')
->willReturn($this->settings);
$this->settings
->expects($this
->at(0))
->method('get')
->with('field_mappings')
->willReturn($this
->getValidFieldMappingsSettings());
$this->settings
->expects($this
->at(1))
->method('get')
->with('thumbnail')
->willReturn($this
->getValidThumbnailSettings());
$this->entityTypeManager
->expects($this
->once())
->method('getStorage')
->with('taxonomy_term')
->willReturn($this->taxonomyTermStorage);
}