17 use PHPUnit\Framework\MockObject\MockObject;
21 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
44 protected function setUp()
46 $GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'encryptionKey']
47 =
'4408d27a916d51e624b69af3554f516dbab61037a9f7b9fd6f81b4d3bedeccb6';
48 $this->subject = $this->createPartialMock(
49 ThumbnailController::class,
62 $this->expectException(\InvalidArgumentException::class);
63 $this->expectExceptionCode(1534484203);
66 'parameters' => json_encode(static::$parameters),
70 $request = (new \TYPO3\CMS\Core\Http\ServerRequest())
71 ->withQueryParams($queryParameters);
72 $this->subject->render($request);
83 'invalid' => [
'invalid'],
95 $this->subject->expects(static::once())
96 ->method(
'generateThumbnail')
97 ->willReturn(
new Response());
101 'hmac' => GeneralUtility::hmac(
103 ThumbnailController::class
107 $request = (new \TYPO3\CMS\Core\Http\ServerRequest())
108 ->withQueryParams($queryParameters);
109 static::assertInstanceOf(
111 $this->subject->render($request)
122 'empty array' => [[]],
123 'parameters' => [static::$parameters],