mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
tests: write a simple Export test for new indicators + fix depreciation with BrowserKit client
cfr: https://symfony.com/doc/4.4/components/browser_kit.html#creating-a-client
This commit is contained in:
parent
287d8f546b
commit
b9186ed6e0
@ -16,6 +16,7 @@ use Doctrine\ORM\NativeQuery;
|
|||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||||
|
use Symfony\Component\BrowserKit\HttpBrowser;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
use Traversable;
|
use Traversable;
|
||||||
@ -332,8 +333,9 @@ abstract class AbstractExportTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testListExportPage()
|
public function testListExportPage()
|
||||||
{
|
{
|
||||||
/** @var \Symfony\Component\BrowserKit\Client $client */
|
/** @var HttpBrowser $client */
|
||||||
$client = $this->getClient();
|
$client = new HttpBrowser();
|
||||||
|
|
||||||
$export = $this->getExport();
|
$export = $this->getExport();
|
||||||
$prophet = new \Prophecy\Prophet();
|
$prophet = new \Prophecy\Prophet();
|
||||||
$container = static::$kernel->getContainer();
|
$container = static::$kernel->getContainer();
|
||||||
|
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Export\Export;
|
||||||
|
|
||||||
|
use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||||
|
use Chill\PersonBundle\Export\Declarations;
|
||||||
|
use Chill\PersonBundle\Export\Export\CountAccompanyingCourse;
|
||||||
|
|
||||||
|
final class CountAccompanyingCourseTest extends AbstractExportTest
|
||||||
|
{
|
||||||
|
private CountAccompanyingCourse $export;
|
||||||
|
|
||||||
|
protected function setUp(): void
|
||||||
|
{
|
||||||
|
self::bootKernel();
|
||||||
|
|
||||||
|
$this->export = self::$container->get('chill.person.export.count_accompanyingcourse');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
public function getExport()
|
||||||
|
{
|
||||||
|
return $this->export;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
public function getFormData(): array
|
||||||
|
{
|
||||||
|
return [[]];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
public function getModifiersCombination()
|
||||||
|
{
|
||||||
|
return [[Declarations::ACP_TYPE]];
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Export\Export;
|
||||||
|
|
||||||
|
use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||||
|
use Chill\PersonBundle\Export\Declarations;
|
||||||
|
use Chill\PersonBundle\Export\Export\StatAccompanyingCourseDuration;
|
||||||
|
|
||||||
|
final class StatAccompanyingCourseDurationTest extends AbstractExportTest
|
||||||
|
{
|
||||||
|
private StatAccompanyingCourseDuration $export;
|
||||||
|
|
||||||
|
protected function setUp(): void
|
||||||
|
{
|
||||||
|
self::bootKernel();
|
||||||
|
|
||||||
|
$this->export = self::$container->get('chill.person.export.avg_accompanyingcourse_duration');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getExport()
|
||||||
|
{
|
||||||
|
return $this->export;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getFormData(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
['closingdate' => \DateTime::createFromFormat('Y-m-d', '2022-06-30')],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getModifiersCombination()
|
||||||
|
{
|
||||||
|
return [[Declarations::ACP_TYPE]];
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user