public function LTIToolProviderTest::testTimestampNonceHandlerAlmostTooOld in LTI Tool Provider 8
Same name and namespace in other branches
- 2.x tests/src/Unit/LTIToolProviderTest.php \Drupal\Tests\lti_tool_provider\Unit\LTIToolProviderTest::testTimestampNonceHandlerAlmostTooOld()
Tests a nonce timestamp that is almost too old.
@covers ::timestampNonceHandler @covers ::__construct
File
- tests/
src/ Unit/ LTIToolProviderTest.php, line 293
Class
- LTIToolProviderTest
- LTIToolProvider unit tests.
Namespace
Drupal\Tests\lti_tool_provider\UnitCode
public function testTimestampNonceHandlerAlmostTooOld() {
$provider = $this
->getNonceSpecificLtiToolProvider();
$this->provider->consumer_key = '';
$this->provider->nonce = uniqid();
$this->provider->timestamp = time() - LTI_TOOL_PROVIDER_NONCE_INTERVAL;
$expected = OAUTH_OK;
$actual = $provider
->timestampNonceHandler($this->provider);
$this
->assertEquals($expected, $actual);
}