mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
fix ProphecyTrait in AbstractFilter to use it with each filter
This commit is contained in:
parent
3dabd031f4
commit
8bbca12487
@ -13,6 +13,7 @@ namespace Chill\MainBundle\Test\Export;
|
|||||||
|
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Exception;
|
use Exception;
|
||||||
|
use Prophecy\PhpUnit\ProphecyTrait;
|
||||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
@ -27,14 +28,16 @@ use function is_string;
|
|||||||
*/
|
*/
|
||||||
abstract class AbstractFilterTest extends KernelTestCase
|
abstract class AbstractFilterTest extends KernelTestCase
|
||||||
{
|
{
|
||||||
|
use ProphecyTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \Prophecy\Prophet
|
* @var \Prophecy\Prophet
|
||||||
*/
|
*/
|
||||||
protected $prophet;
|
private $prophet;
|
||||||
|
|
||||||
protected function setUp(): void
|
protected function setUp(): void
|
||||||
{
|
{
|
||||||
$this->prepareProphet();
|
$$this->prophet = $this->getProphet();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function dataProviderAlterQuery()
|
public function dataProviderAlterQuery()
|
||||||
|
@ -14,11 +14,9 @@ class EmergencyFilterTest extends AbstractFilterTest
|
|||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
// add a fake request with a default locale (used in translatable string)
|
// add a fake request with a default locale (used in translatable string)
|
||||||
$prophet = new \Prophecy\Prophet();
|
$request = $this->prophesize();
|
||||||
$request = $prophet->prophesize();
|
|
||||||
|
|
||||||
$request->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
$request->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
||||||
|
|
||||||
$request->getLocale()->willReturn('fr');
|
$request->getLocale()->willReturn('fr');
|
||||||
|
|
||||||
$this->filter = self::$container->get('chill.person.export.filter_emergency');
|
$this->filter = self::$container->get('chill.person.export.filter_emergency');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user