Skip to content

Commit

Permalink
[TASK] Replace prophecy in ext:reports tests
Browse files Browse the repository at this point in the history
Resolves: #98639
Releases: main
Change-Id: Id2561c857aa4d7a61ade2f23e6909f1f9cdad665
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/76131
Tested-by: core-ci <typo3@b13.com>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
  • Loading branch information
derhansen authored and sbuerk committed Oct 17, 2022
1 parent 57c11dc commit 5aec231
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
15 changes: 6 additions & 9 deletions typo3/sysext/reports/Tests/Unit/Report/Status/StatusTest.php
Expand Up @@ -17,7 +17,6 @@

namespace TYPO3\CMS\Reports\Tests\Unit\Report\Status;

use Prophecy\PhpUnit\ProphecyTrait;
use Psr\Container\ContainerInterface;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Backend\View\BackendViewFactory;
Expand All @@ -37,13 +36,11 @@

class StatusTest extends UnitTestCase
{
use ProphecyTrait;

protected function setUp(): void
{
parent::setUp();
$languageServiceProphecy = $this->prophesize(LanguageService::class);
$GLOBALS['LANG'] = $languageServiceProphecy->reveal();
$mockLanguageService = $this->getMockBuilder(LanguageService::class)->disableOriginalConstructor()->getMock();
$GLOBALS['LANG'] = $mockLanguageService;
}

/**
Expand Down Expand Up @@ -131,11 +128,11 @@ public function getDetailedSystemStatusReturnsOnlyExtendedStatuses(): void
*/
private function createSubject(array $statusProviderArguments): Status
{
$container = $this->prophesize(ContainerInterface::class)->reveal();
$cacheManager = $this->prophesize(CacheManager::class)->reveal();
$viewHelperResolverFactory = $this->prophesize(ViewHelperResolverFactoryInterface::class)->reveal();
$container = $this->getMockBuilder(ContainerInterface::class)->getMock();
$cacheManager = new CacheManager();
$viewHelperResolverFactory = $this->getMockBuilder(ViewHelperResolverFactoryInterface::class)->getMock();
$renderingContextFactory = new RenderingContextFactory($container, $cacheManager, $viewHelperResolverFactory);
$packageManager = $this->prophesize(PackageManager::class)->reveal();
$packageManager = $this->getMockBuilder(PackageManager::class)->disableOriginalConstructor()->getMock();
$backendViewFactory = new BackendViewFactory($renderingContextFactory, $packageManager);
$statusRegistry = new StatusRegistry($this->generateStatusProviders($statusProviderArguments));

Expand Down
Expand Up @@ -17,8 +17,6 @@

namespace TYPO3\CMS\Reports\Tests\Unit\Report\Status;

use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity;
use TYPO3\CMS\Reports\Report\Status\Typo3Status;
Expand All @@ -29,17 +27,14 @@
*/
class Typo3StatusTest extends UnitTestCase
{
use ProphecyTrait;

/**
* Set up
*/
protected function setUp(): void
{
parent::setUp();
$languageServiceProphecy = $this->prophesize(LanguageService::class);
$languageServiceProphecy->getLL(Argument::any())->willReturn('');
$GLOBALS['LANG'] = $languageServiceProphecy->reveal();
$mockLanguageService = $this->getMockBuilder(LanguageService::class)->disableOriginalConstructor()->getMock();
$GLOBALS['LANG'] = $mockLanguageService;
}

/**
Expand Down

0 comments on commit 5aec231

Please sign in to comment.