improve exports & add new filter, export, aggregators

This commit is contained in:
2017-01-17 00:34:32 +01:00
parent b36ec02b65
commit 67c8c19885
8 changed files with 793 additions and 28 deletions

View File

@@ -0,0 +1,93 @@
<?php
/*
* Copyright (C) 2017 Champs-Libres <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\ActivityBundle\Tests\Export\Export;
use Chill\MainBundle\Test\Export\AbstractExportTest;
/**
*
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class ListActivityTest extends AbstractExportTest
{
/**
*
* @var \Chill\ActivityBundle\Export\Export\ListActivity
*/
private $export;
public function setUp()
{
static::bootKernel();
/* @var $container \Symfony\Component\DependencyInjection\ContainerInterface */
$container = self::$kernel->getContainer();
$this->export = $container->get('chill.activity.export.list_activity');
// 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')
->push($request->reveal());
}
public function getFormData()
{
return array(
array('fields' => array(
'id',
'date',
'durationTime',
'attendee',
'user_username',
'circle_name',
'type_name',
'person_firstname',
'person_lastname',
'person_id'
)),
array('fields' => array(
'id',
'list_reasons'
)),
);
}
public function getModifiersCombination()
{
return array(
array('activity'),
array('activity', 'person')
);
}
public function getExport()
{
return $this->export;
}
}