Skip to content

Commit

Permalink
[TASK] Replace prophecy in EXT:extbase QueryTest
Browse files Browse the repository at this point in the history
Resolves: #98898
Releases: main
Change-Id: I62c2915adb19bc8cc124cab51e4f99782053b4d9
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/76304
Tested-by: Nikita Hovratov <nikita.h@live.de>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Nikita Hovratov <nikita.h@live.de>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
  • Loading branch information
derhansen authored and sbuerk committed Oct 27, 2022
1 parent ec8a26c commit 6dd8d7a
Showing 1 changed file with 11 additions and 36 deletions.
47 changes: 11 additions & 36 deletions typo3/sysext/extbase/Tests/Unit/Persistence/Generic/QueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
namespace TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic;

use PHPUnit\Framework\MockObject\MockObject;
use Prophecy\PhpUnit\ProphecyTrait;
use Psr\Container\ContainerInterface;
use TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory;
use TYPO3\CMS\Extbase\Persistence\Generic\Qom\Comparison;
Expand All @@ -35,37 +34,13 @@
use TYPO3\TestingFramework\Core\AccessibleObjectInterface;
use TYPO3\TestingFramework\Core\Unit\UnitTestCase;

/**
* Test case
*/
class QueryTest extends UnitTestCase
{
use ProphecyTrait;

/**
* @var Query|MockObject|AccessibleObjectInterface
*/
protected $query;

/**
* @var QuerySettingsInterface
*/
protected $querySettings;

/**
* @var PersistenceManagerInterface
*/
protected $persistenceManager;

/**
* @var DataMapFactory
*/
protected $dataMapFactory;

/**
* @var ContainerInterface
*/
protected $container;
protected Query&MockObject&AccessibleObjectInterface $query;
protected QuerySettingsInterface $querySettings;
protected PersistenceManagerInterface $persistenceManager;
protected DataMapFactory $dataMapFactory;
protected ContainerInterface $container;

/**
* Sets up this test case
Expand Down Expand Up @@ -183,10 +158,10 @@ public function equalsForCaseSensitiveFalseLowercasesOperand(string $propertyNam
public function logicalAndSupportsMultipleConstraintsAsMethodArguments(): void
{
$subject = new Query(
$this->prophesize(DataMapFactory::class)->reveal(),
$this->prophesize(PersistenceManagerInterface::class)->reveal(),
$this->createMock(DataMapFactory::class),
$this->createMock(PersistenceManagerInterface::class),
new QueryObjectModelFactory(),
$this->prophesize(ContainerInterface::class)->reveal()
$this->createMock(ContainerInterface::class)
);

$constraint1 = new Comparison(new PropertyValue('propertyName1'), QueryInterface::OPERATOR_EQUAL_TO, 'value1');
Expand All @@ -206,10 +181,10 @@ public function logicalAndSupportsMultipleConstraintsAsMethodArguments(): void
public function logicalOrSupportsMultipleConstraintsAsMethodArguments(): void
{
$subject = new Query(
$this->prophesize(DataMapFactory::class)->reveal(),
$this->prophesize(PersistenceManagerInterface::class)->reveal(),
$this->createMock(DataMapFactory::class),
$this->createMock(PersistenceManagerInterface::class),
new QueryObjectModelFactory(),
$this->prophesize(ContainerInterface::class)->reveal()
$this->createMock(ContainerInterface::class)
);

$constraint1 = new Comparison(new PropertyValue('propertyName1'), QueryInterface::OPERATOR_EQUAL_TO, 'value1');
Expand Down

0 comments on commit 6dd8d7a

Please sign in to comment.