public function PathContextTest::setUp in Acquia Lift Connector 8
Overrides UnitTestCase::setUp
File
- tests/
src/ Unit/ Service/ Context/ PathContextTest.php, line 67 - Contains \Drupal\Tests\acquia_lift\Service\Context\PathContextTest.
Class
- PathContextTest
- PathContextTest 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->currentPathStack = $this
->getMockBuilder('Drupal\\Core\\Path\\CurrentPathStack')
->disableOriginalConstructor()
->getMock();
$this->requestStack = $this
->getMock('Symfony\\Component\\HttpFoundation\\RequestStack');
$this->pathMatcher = $this
->getMockBuilder('Drupal\\acquia_lift\\Service\\Helper\\PathMatcher')
->disableOriginalConstructor()
->getMock();
$this->request = $this
->getMock('Symfony\\Component\\HttpFoundation\\Request');
$this->configFactory
->expects($this
->once())
->method('get')
->with('acquia_lift.settings')
->willReturn($this->settings);
$visibility_settings = $this
->getValidVisibilitySettings();
$this->settings
->expects($this
->at(2))
->method('get')
->with('visibility')
->willReturn($visibility_settings);
$this->currentPathStack
->expects($this
->once())
->method('getPath')
->willReturn('my_current_path');
}