You are here

public function LTIToolProviderTest::getNonceSpecificLtiToolProvider in LTI Tool Provider 2.x

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

Generate a entity type manager for testing timestampNonceHandler.

3 calls to LTIToolProviderTest::getNonceSpecificLtiToolProvider()
LTIToolProviderTest::testTimestampNonceHandlerAlmostTooNew in tests/src/Unit/LTIToolProviderTest.php
Tests a nonce timestamp that is almost too new.
LTIToolProviderTest::testTimestampNonceHandlerAlmostTooOld in tests/src/Unit/LTIToolProviderTest.php
Tests a nonce timestamp that is almost too old.
LTIToolProviderTest::testTimestampNonceHandlerCurrent in tests/src/Unit/LTIToolProviderTest.php
Tests a nonce timestamp that is current.

File

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

Class

LTIToolProviderTest
LTIToolProvider unit tests.

Namespace

Drupal\Tests\lti_tool_provider\Unit

Code

public function getNonceSpecificLtiToolProvider() : LTIToolProvider {
  $entityTypeManager = $this->entityTypeManager;
  $query = $this
    ->createMock('Drupal\\Core\\Entity\\Query\\QueryInterface');
  $query
    ->expects($this
    ->once())
    ->method('condition')
    ->will($this
    ->returnValue($query));
  $query
    ->expects($this
    ->once())
    ->method('execute')
    ->will($this
    ->returnValue([]));
  $storage = $this
    ->createMock('Drupal\\Core\\Entity\\EntityStorageInterface');
  $storage
    ->expects($this
    ->once())
    ->method('getQuery')
    ->will($this
    ->returnValue($query));
  $storage
    ->expects($this
    ->once())
    ->method('create')
    ->will($this
    ->returnValue($this
    ->createMock('Drupal\\Core\\Entity\\EntityInterface')));
  $entityTypeManager
    ->expects($this
    ->once())
    ->method('getStorage')
    ->will($this
    ->returnValue($storage));
  return new LTIToolProvider($this->configFactory, $entityTypeManager, $this->loggerFactory, $this->eventDispatcher);
}