mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Make data providers static on AbstractExportTest.php and Write a rector rule to adapt existing
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Chill\PersonBundle\Tests\Export\Export;
|
||||
|
||||
use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
use Chill\PersonBundle\Export\Export\CountPerson;
|
||||
use Chill\PersonBundle\Repository\PersonRepository;
|
||||
|
||||
/**
|
||||
* Test CountPerson export.
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
final class CountPersonTest extends AbstractExportTest
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
}
|
||||
|
||||
public function getExport()
|
||||
{
|
||||
$personRepository = self::getContainer()->get(PersonRepository::class);
|
||||
|
||||
yield new CountPerson($personRepository, $this->getParameters(true));
|
||||
yield new CountPerson($personRepository, $this->getParameters(false));
|
||||
}
|
||||
|
||||
public static function getFormData(): array
|
||||
{
|
||||
return [
|
||||
[],
|
||||
];
|
||||
}
|
||||
|
||||
public static function getModifiersCombination(): array
|
||||
{
|
||||
return [['person']];
|
||||
}
|
||||
}
|
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Chill\PersonBundle\Tests\Export\Export;
|
||||
|
||||
use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
use Chill\PersonBundle\Export\Export\CountPerson;
|
||||
use Chill\PersonBundle\Repository\PersonRepository;
|
||||
|
||||
/**
|
||||
* Test CountPerson export.
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
final class CountPersonTest extends AbstractExportTest
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
}
|
||||
|
||||
public function getExport()
|
||||
{
|
||||
$personRepository = self::getContainer()->get(PersonRepository::class);
|
||||
|
||||
yield new CountPerson($personRepository, $this->getParameters(true));
|
||||
yield new CountPerson($personRepository, $this->getParameters(false));
|
||||
}
|
||||
|
||||
public function getFormData()
|
||||
{
|
||||
return [
|
||||
[],
|
||||
];
|
||||
}
|
||||
|
||||
public function getModifiersCombination()
|
||||
{
|
||||
return [['person']];
|
||||
}
|
||||
}
|
||||
-----
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Chill\PersonBundle\Tests\Export\Export;
|
||||
|
||||
use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
use Chill\PersonBundle\Export\Export\CountPerson;
|
||||
use Chill\PersonBundle\Repository\PersonRepository;
|
||||
|
||||
/**
|
||||
* Test CountPerson export.
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
final class CountPersonTest extends AbstractExportTest
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
}
|
||||
|
||||
public function getExport()
|
||||
{
|
||||
$personRepository = self::getContainer()->get(PersonRepository::class);
|
||||
|
||||
yield new CountPerson($personRepository, $this->getParameters(true));
|
||||
yield new CountPerson($personRepository, $this->getParameters(false));
|
||||
}
|
||||
|
||||
public static function getFormData(): array
|
||||
{
|
||||
return [
|
||||
[],
|
||||
];
|
||||
}
|
||||
|
||||
public static function getModifiersCombination(): array
|
||||
{
|
||||
return [['person']];
|
||||
}
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
class MyException extends \RuntimeException
|
||||
{
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
final readonly class MyClass {
|
||||
|
||||
}
|
Reference in New Issue
Block a user