Skip to content

Commit e65724c

Browse files
committed
[BUGFIX] Add BackendUserAuthentication to RedirectDemandServiceTest
Related #42
1 parent 1394c0f commit e65724c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Tests/Functional/Service/RedirectDemandServiceTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Ayacoo\RedirectTab\Service\RedirectDemandService;
88
use PHPUnit\Framework\Attributes\Test;
9+
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
910
use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface;
1011
use TYPO3\CMS\Core\Configuration\SiteConfiguration;
1112
use TYPO3\CMS\Core\Site\Entity\NullSite;
@@ -24,6 +25,9 @@ final class RedirectDemandServiceTest extends FunctionalTestCase
2425
protected function setUp(): void
2526
{
2627
parent::setUp();
28+
$backendUserAuthentication = $this->createMock(BackendUserAuthentication::class);
29+
$backendUserAuthentication->method('isAdmin')->withAnyParameters()->willReturn(true);
30+
$GLOBALS['BE_USER'] = $backendUserAuthentication;
2731

2832
$this->subject = $this->get(RedirectDemandService::class);
2933
}

0 commit comments

Comments
 (0)