Commit 74593e71 authored by Anja Leichsenring's avatar Anja Leichsenring Committed by Christian Kuhn
Browse files

[TASK] Replace Mock with real instance in ReferrerEnforcerTest

Usage of real instances in tests avoid the awkward situation
that the test might not be useful anymore due to refactoring
and reworking over time without anyone noticing.
Mocks must only be used if necessary.

Resolves: #93866
Releases: master, 10.4
Change-Id: I9095f0f6b0fb9b5c387b5c6150d82a9f5f07170f
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/68718

Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 3e4edfc8
...@@ -212,13 +212,6 @@ class ReferrerEnforcerTest extends UnitTestCase ...@@ -212,13 +212,6 @@ class ReferrerEnforcerTest extends UnitTestCase
$request->getUri()->willReturn($requestUriInstance); $request->getUri()->willReturn($requestUriInstance);
$request->getQueryParams()->willReturn($queryParams); $request->getQueryParams()->willReturn($queryParams);
$subject = $this->getMockBuilder(ReferrerEnforcer::class) return new ReferrerEnforcer($request->reveal());
->setConstructorArgs([$request->reveal()])
->onlyMethods(['resolveAbsoluteWebPath'])
->getMock();
$subject->method('resolveAbsoluteWebPath')
->with('EXT:core/Resources/Public/JavaScript/ReferrerRefresh.js')
->willReturn('/typo3/sysext/core/Resources/Public/JavaScript/ReferrerRefresh.js');
return $subject;
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment