You are here

protected function LTIToolProviderTest::setUp in LTI Tool Provider 8

Same name and namespace in other branches
  1. 2.x tests/src/Unit/LTIToolProviderTest.php \Drupal\Tests\lti_tool_provider\Unit\LTIToolProviderTest::setUp()

Overrides UnitTestCase::setUp

File

tests/src/Unit/LTIToolProviderTest.php, line 74

Class

LTIToolProviderTest
LTIToolProvider unit tests.

Namespace

Drupal\Tests\lti_tool_provider\Unit

Code

protected function setUp() : void {
  parent::setUp();
  $this->configFactory = $this
    ->createMock('\\Drupal\\Core\\Config\\ConfigFactoryInterface');
  $this->entityTypeManager = $this
    ->createMock('\\Drupal\\Core\\Entity\\EntityTypeManagerInterface');
  $this->eventDispatcher = $this
    ->getMockBuilder('\\Symfony\\Component\\EventDispatcher\\EventDispatcher')
    ->onlyMethods([
    '__construct',
  ])
    ->disableOriginalConstructor()
    ->getMock();
  $this->loggerFactory = $this
    ->getMockBuilder('\\Drupal\\Core\\Logger\\LoggerChannelFactory')
    ->addMethods([
    '__construct',
  ])
    ->disableOriginalConstructor()
    ->getMock();
  $this->provider = $this
    ->getMockBuilder('\\OAuthProvider')
    ->onlyMethods([
    '__construct',
    'checkOAuthRequest',
  ])
    ->disableOriginalConstructor()
    ->getMock();
  $this->provider
    ->expects($this
    ->any())
    ->method('checkOAuthRequest')
    ->will($this
    ->returnValue(true));
}