Add tests for new exports calendar

This commit is contained in:
Julie Lenaerts 2023-11-15 16:34:08 +01:00
parent 33235d3541
commit e0de10b7a8
3 changed files with 165 additions and 0 deletions

View File

@ -0,0 +1,55 @@
<?php
namespace Chill\CalendarBundle\Tests\Export\Export;
use Chill\CalendarBundle\Export\Declarations;
use Chill\CalendarBundle\Export\Export\LinkedToAcp\CountCalendars as CountCalendarsLinkedToAcp;
use Chill\CalendarBundle\Export\Export\LinkedToPerson\CountCalendars as CountCalendarsLinkedToPerson;
use Chill\CalendarBundle\Repository\CalendarRepository;
use Chill\MainBundle\Test\Export\AbstractExportTest;
/**
* @internal
*
* @coversNothing
*/
class CountCalendarsTest extends AbstractExportTest
{
protected function setUp(): void
{
self::bootKernel();
}
/**
* @inheritDoc
*/
public function getExport()
{
$repository = self::$container->get(CalendarRepository::class);
yield new CountCalendarsLinkedToAcp($repository, $this->getParameters(true));
yield new CountCalendarsLinkedToAcp($repository, $this->getParameters(false));
yield new CountCalendarsLinkedToPerson($repository, $this->getParameters(true));
yield new CountCalendarsLinkedToPerson($repository, $this->getParameters(false));
}
/**
* @inheritDoc
*/
public function getFormData()
{
return [];
}
/**
* @inheritDoc
*/
public function getModifiersCombination()
{
return [
[
Declarations::CALENDAR_TYPE,
]];
}
}

View File

@ -0,0 +1,55 @@
<?php
namespace Chill\CalendarBundle\Tests\Export\Export;
use Chill\CalendarBundle\Export\Declarations;
use Chill\CalendarBundle\Export\Export\LinkedToAcp\StatCalendarAvgDuration as StatCalendarAvgDurationLinkedToAcp;
use Chill\CalendarBundle\Export\Export\LinkedToPerson\StatCalendarAvgDuration as StatCalendarAvgDurationLinkedToPerson;
use Chill\CalendarBundle\Repository\CalendarRepository;
use Chill\MainBundle\Test\Export\AbstractExportTest;
/**
* @internal
*
* @coversNothing
*/
class StatCalendarAvgDurationTest extends AbstractExportTest
{
protected function setUp(): void
{
self::bootKernel();
}
/**
* @inheritDoc
*/
public function getExport()
{
$repository = self::$container->get(CalendarRepository::class);
yield new StatCalendarAvgDurationLinkedToAcp($repository, $this->getParameters(true));
yield new StatCalendarAvgDurationLinkedToAcp($repository, $this->getParameters(false));
yield new StatCalendarAvgDurationLinkedToPerson($repository, $this->getParameters(true));
yield new StatCalendarAvgDurationLinkedToPerson($repository, $this->getParameters(false));
}
/**
* @inheritDoc
*/
public function getFormData()
{
return [];
}
/**
* @inheritDoc
*/
public function getModifiersCombination()
{
return [
[
Declarations::CALENDAR_TYPE,
]];
}
}

View File

@ -0,0 +1,55 @@
<?php
namespace Chill\CalendarBundle\Tests\Export\Export;
use Chill\CalendarBundle\Export\Declarations;
use Chill\CalendarBundle\Export\Export\LinkedToAcp\StatCalendarSumDuration as StatCalendarSumDurationLinkedToAcp;
use Chill\CalendarBundle\Export\Export\LinkedToPerson\StatCalendarSumDuration as StatCalendarSumDurationLinkedToPerson;
use Chill\CalendarBundle\Repository\CalendarRepository;
use Chill\MainBundle\Test\Export\AbstractExportTest;
/**
* @internal
*
* @coversNothing
*/
class StatCalendarSumDurationTest extends AbstractExportTest
{
protected function setUp(): void
{
self::bootKernel();
}
/**
* @inheritDoc
*/
public function getExport()
{
$repository = self::$container->get(CalendarRepository::class);
yield new StatCalendarSumDurationLinkedToAcp($repository, $this->getParameters(true));
yield new StatCalendarSumDurationLinkedToAcp($repository, $this->getParameters(false));
yield new StatCalendarSumDurationLinkedToPerson($repository, $this->getParameters(true));
yield new StatCalendarSumDurationLinkedToPerson($repository, $this->getParameters(false));
}
/**
* @inheritDoc
*/
public function getFormData()
{
return [];
}
/**
* @inheritDoc
*/
public function getModifiersCombination()
{
return [
[
Declarations::CALENDAR_TYPE,
]];
}
}