You are here

private function JsonLogTest::setupContainerCurrentRequest in JSONlog 8

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/JsonLogTest.php \Drupal\Tests\jsonlog\Unit\JsonLogTest::setupContainerCurrentRequest()
  2. 3.x tests/src/Unit/JsonLogTest.php \Drupal\Tests\jsonlog\Unit\JsonLogTest::setupContainerCurrentRequest()

Parameters

\Symfony\Component\HttpFoundation\Request $request:

1 call to JsonLogTest::setupContainerCurrentRequest()
JsonLogTest::testCanPrepareLogFile in tests/src/Unit/JsonLogTest.php
test to see if a log file is well prepared

File

tests/src/Unit/JsonLogTest.php, line 137

Class

JsonLogTest
Unit tests for JsonLog class

Namespace

Drupal\Tests\jsonlog\Unit

Code

private function setupContainerCurrentRequest(Request $request) {
  $this->requestStackMock
    ->expects($this
    ->any())
    ->method('getCurrentRequest')
    ->willReturn($request);
  $containerMock = $this
    ->createMock('Symfony\\Component\\DependencyInjection\\ContainerInterface');
  $containerMock
    ->expects($this
    ->any())
    ->method('get')
    ->with('request_stack')
    ->willReturn($this->requestStackMock);

  /** @var \Symfony\Component\DependencyInjection\ContainerInterface $containerMock */
  \Drupal::setContainer($containerMock);
}