Skip to content

Commit

Permalink
Bugfix fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesbochmann committed Feb 26, 2024
1 parent 5ca28e7 commit 55ebff9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Tests/Unit/Cache/VarnishBackendTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace DMK\Mkvarnish\Tests\Unit\Hooks;
namespace DMK\Mkvarnish\Tests\Unit\Cache;

use DMK\Mkvarnish\Cache\VarnishBackend;
use DMK\Mkvarnish\Repository\CacheTagsRepository;
Expand Down Expand Up @@ -50,17 +50,25 @@ class VarnishBackendTest extends UnitTestCase
*/
private $extConfBackup = [];

/**
* @var string
*/
private $encryptionKeyBackup;

protected function setUp(): void
{
$this->siteNameBackup = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
$this->extConfBackup = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['mkvarnish'] ?? [];
$this->encryptionKeyBackup = $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] ?? '';
$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] = 'testKey';
parent::setUp();
}

protected function tearDown(): void
{
$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] = $this->siteNameBackup;
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['mkvarnish'] = $this->extConfBackup;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] = $this->encryptionKeyBackup;
parent::tearDown();
}

Expand Down

0 comments on commit 55ebff9

Please sign in to comment.