mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
activity export export tests
This commit is contained in:
parent
2b8fe462ea
commit
f5fb721ddd
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\ActivityBundle\Tests\Export\Export\LinkedToACP;
|
||||
|
||||
use Chill\ActivityBundle\Export\Export\LinkedToACP\CountActivity;
|
||||
use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @coversNothing
|
||||
*/
|
||||
final class CountActivityTest extends AbstractExportTest
|
||||
{
|
||||
private CountActivity $export;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$this->export = self::$container->get('chill.activity.export.count_activity_linked_to_acp');
|
||||
}
|
||||
|
||||
public function getExport()
|
||||
{
|
||||
return $this->export;
|
||||
}
|
||||
|
||||
public function getFormData(): array
|
||||
{
|
||||
return [
|
||||
[],
|
||||
];
|
||||
}
|
||||
|
||||
public function getModifiersCombination(): array
|
||||
{
|
||||
return [
|
||||
['activity'],
|
||||
['activity', 'accompanying_period'],
|
||||
];
|
||||
}
|
||||
}
|
@ -9,8 +9,9 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\ActivityBundle\Tests\Export\Export;
|
||||
namespace Chill\ActivityBundle\Tests\Export\Export\LinkedToPerson;
|
||||
|
||||
use Chill\ActivityBundle\Export\Export\LinkedToPerson\CountActivity;
|
||||
use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
|
||||
/**
|
||||
@ -19,19 +20,13 @@ use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
*/
|
||||
final class CountActivityTest extends AbstractExportTest
|
||||
{
|
||||
/**
|
||||
* @var
|
||||
*/
|
||||
private $export;
|
||||
private CountActivity $export;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
/** @var \Symfony\Component\DependencyInjection\ContainerInterface $container */
|
||||
$container = self::$kernel->getContainer();
|
||||
|
||||
$this->export = $container->get('chill.activity.export.count_activity');
|
||||
$this->export = self::$container->get('chill.activity.export.count_activity_linked_to_person');
|
||||
}
|
||||
|
||||
public function getExport()
|
||||
@ -39,14 +34,14 @@ final class CountActivityTest extends AbstractExportTest
|
||||
return $this->export;
|
||||
}
|
||||
|
||||
public function getFormData()
|
||||
public function getFormData(): array
|
||||
{
|
||||
return [
|
||||
[],
|
||||
];
|
||||
}
|
||||
|
||||
public function getModifiersCombination()
|
||||
public function getModifiersCombination(): array
|
||||
{
|
||||
return [
|
||||
['activity'],
|
@ -9,9 +9,11 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\ActivityBundle\Tests\Export\Export;
|
||||
namespace Chill\ActivityBundle\Tests\Export\Export\LinkedToPerson;
|
||||
|
||||
use Chill\ActivityBundle\Export\Export\LinkedToPerson\ListActivity;
|
||||
use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
use Prophecy\PhpUnit\ProphecyTrait;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
@ -19,27 +21,22 @@ use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
*/
|
||||
final class ListActivityTest extends AbstractExportTest
|
||||
{
|
||||
/**
|
||||
* @var \Chill\ActivityBundle\Export\Export\ListActivity
|
||||
*/
|
||||
private $export;
|
||||
use ProphecyTrait;
|
||||
|
||||
private ListActivity $export;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
/** @var \Symfony\Component\DependencyInjection\ContainerInterface $container */
|
||||
$container = self::$kernel->getContainer();
|
||||
$this->export = self::$container->get('chill.activity.export.list_activity_linked_to_person');
|
||||
|
||||
$this->export = $container->get('chill.activity.export.list_activity');
|
||||
$request = $this->prophesize()
|
||||
->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
||||
|
||||
// add a fake request with a default locale (used in translatable string)
|
||||
$prophet = new \Prophecy\Prophet();
|
||||
$request = $prophet->prophesize();
|
||||
$request->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
||||
$request->getLocale()->willReturn('fr');
|
||||
|
||||
$container->get('request_stack')
|
||||
self::$container->get('request_stack')
|
||||
->push($request->reveal());
|
||||
}
|
||||
|
@ -9,8 +9,9 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\ActivityBundle\Tests\Export\Export;
|
||||
namespace Chill\ActivityBundle\Tests\Export\Export\LinkedToPerson;
|
||||
|
||||
use Chill\ActivityBundle\Export\Export\LinkedToPerson\StatActivityDuration;
|
||||
use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
|
||||
/**
|
||||
@ -19,21 +20,15 @@ use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
* @internal
|
||||
* @coversNothing
|
||||
*/
|
||||
final class StatActivityDurationSumTest extends AbstractExportTest
|
||||
final class StatActivityDurationTest extends AbstractExportTest
|
||||
{
|
||||
/**
|
||||
* @var \Chill\ActivityBundle\Export\Export\StatActivityDuration
|
||||
*/
|
||||
private $export;
|
||||
private StatActivityDuration $export;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
/** @var \Symfony\Component\DependencyInjection\ContainerInterface $container */
|
||||
$container = self::$kernel->getContainer();
|
||||
|
||||
$this->export = $container->get('chill.activity.export.sum_activity_duration');
|
||||
$this->export = self::$container->get('chill.activity.export.sum_activity_duration_linked_to_person');
|
||||
}
|
||||
|
||||
public function getExport()
|
||||
@ -41,14 +36,14 @@ final class StatActivityDurationSumTest extends AbstractExportTest
|
||||
return $this->export;
|
||||
}
|
||||
|
||||
public function getFormData()
|
||||
public function getFormData(): array
|
||||
{
|
||||
return [
|
||||
[],
|
||||
];
|
||||
}
|
||||
|
||||
public function getModifiersCombination()
|
||||
public function getModifiersCombination(): array
|
||||
{
|
||||
return [
|
||||
['activity'],
|
Loading…
x
Reference in New Issue
Block a user