mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
remove references to ->getContainer in favor of static::
This commit is contained in:
parent
6df8e6dec8
commit
c93d5ceb16
@ -172,6 +172,7 @@ abstract class AbstractExportTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testInitiateQuery($modifiers, $acl, $data)
|
public function testInitiateQuery($modifiers, $acl, $data)
|
||||||
{
|
{
|
||||||
|
var_dump($data);
|
||||||
$query = $this->getExport()->initiateQuery($modifiers, $acl, $data);
|
$query = $this->getExport()->initiateQuery($modifiers, $acl, $data);
|
||||||
|
|
||||||
$this->assertTrue($query instanceof QueryBuilder || $query instanceof NativeQuery,
|
$this->assertTrue($query instanceof QueryBuilder || $query instanceof NativeQuery,
|
||||||
|
@ -11,7 +11,7 @@ class PersonDuplicateControllerViewTest extends WebTestCase
|
|||||||
{
|
{
|
||||||
static::bootKernel();
|
static::bootKernel();
|
||||||
|
|
||||||
$this->em = static::$kernel->getContainer()
|
$this->em = static::$container
|
||||||
->get('doctrine.orm.entity_manager');
|
->get('doctrine.orm.entity_manager');
|
||||||
|
|
||||||
$center = $this->em->getRepository('ChillMainBundle:Center')
|
$center = $this->em->getRepository('ChillMainBundle:Center')
|
||||||
|
@ -38,9 +38,7 @@ class AgeAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
static::bootKernel();
|
static::bootKernel();
|
||||||
|
|
||||||
$container = static::$kernel->getContainer();
|
$this->aggregator = static::$container->get('chill.person.export.aggregator_age');
|
||||||
|
|
||||||
$this->aggregator = $container->get('chill.person.export.aggregator_age');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator()
|
||||||
@ -63,7 +61,7 @@ class AgeAggregatorTest extends AbstractAggregatorTest
|
|||||||
static::bootKernel();
|
static::bootKernel();
|
||||||
}
|
}
|
||||||
|
|
||||||
$em = static::$kernel->getContainer()
|
$em = static::$container
|
||||||
->get('doctrine.orm.entity_manager');
|
->get('doctrine.orm.entity_manager');
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
@ -37,9 +37,7 @@ class GenderAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
static::bootKernel();
|
static::bootKernel();
|
||||||
|
|
||||||
$container = static::$kernel->getContainer();
|
$this->aggregator = static::$container->get('chill.person.export.aggregator_gender');
|
||||||
|
|
||||||
$this->aggregator = $container->get('chill.person.export.aggregator_gender');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator()
|
||||||
@ -60,7 +58,7 @@ class GenderAggregatorTest extends AbstractAggregatorTest
|
|||||||
static::bootKernel();
|
static::bootKernel();
|
||||||
}
|
}
|
||||||
|
|
||||||
$em = static::$kernel->getContainer()
|
$em = static::$container
|
||||||
->get('doctrine.orm.entity_manager');
|
->get('doctrine.orm.entity_manager');
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
namespace Chill\PersonBundle\Tests\Export\Aggregator;
|
namespace Chill\PersonBundle\Tests\Export\Aggregator;
|
||||||
|
|
||||||
require_once '/home/julien/dev/chill-dev/vendor/chill-project/main/Test/Export/AbstractAggregatorTest.php';
|
|
||||||
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -25,7 +24,7 @@ use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
|||||||
*
|
*
|
||||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||||
*/
|
*/
|
||||||
class NationalityAggregator extends AbstractAggregatorTest
|
class NationalityAggregatorTest extends AbstractAggregatorTest
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -37,9 +36,7 @@ class NationalityAggregator extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
static::bootKernel();
|
static::bootKernel();
|
||||||
|
|
||||||
$container = static::$kernel->getContainer();
|
$this->aggregator = static::$container->get('chill.person.export.aggregator_nationality');
|
||||||
|
|
||||||
$this->aggregator = $container->get('chill.person.export.aggregator_nationality');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator()
|
||||||
@ -61,7 +58,7 @@ class NationalityAggregator extends AbstractAggregatorTest
|
|||||||
static::bootKernel();
|
static::bootKernel();
|
||||||
}
|
}
|
||||||
|
|
||||||
$em = static::$kernel->getContainer()
|
$em = static::$container
|
||||||
->get('doctrine.orm.entity_manager');
|
->get('doctrine.orm.entity_manager');
|
||||||
|
|
||||||
return array(
|
return array(
|
@ -36,10 +36,7 @@ class CountPersonTest extends AbstractExportTest
|
|||||||
{
|
{
|
||||||
static::bootKernel();
|
static::bootKernel();
|
||||||
|
|
||||||
/* @var $container \Symfony\Component\DependencyInjection\ContainerInterface */
|
$this->export = static::$container->get('chill.person.export.export_count_person');
|
||||||
$container = self::$kernel->getContainer();
|
|
||||||
|
|
||||||
$this->export = $container->get('chill.person.export.export_count_person');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,10 +40,7 @@ class ListPersonTest extends AbstractExportTest
|
|||||||
{
|
{
|
||||||
static::bootKernel();
|
static::bootKernel();
|
||||||
|
|
||||||
/* @var $container \Symfony\Component\DependencyInjection\ContainerInterface */
|
$this->export = static::$container->get('chill.person.export.list_person');
|
||||||
$container = self::$kernel->getContainer();
|
|
||||||
|
|
||||||
$this->export = $container->get('chill.person.export.list_person');
|
|
||||||
|
|
||||||
// add a fake request with a default locale (used in translatable string)
|
// add a fake request with a default locale (used in translatable string)
|
||||||
$prophet = new \Prophecy\Prophet;
|
$prophet = new \Prophecy\Prophet;
|
||||||
@ -51,7 +48,7 @@ class ListPersonTest extends AbstractExportTest
|
|||||||
$request->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
$request->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
||||||
$request->getLocale()->willReturn('fr');
|
$request->getLocale()->willReturn('fr');
|
||||||
|
|
||||||
$container->get('request_stack')
|
static::$container->get('request_stack')
|
||||||
->push($request->reveal());
|
->push($request->reveal());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,10 +36,8 @@ class AccompanyingPeriodFilterTest extends AbstractFilterTest
|
|||||||
{
|
{
|
||||||
static::bootKernel();
|
static::bootKernel();
|
||||||
|
|
||||||
$container = static::$kernel->getContainer();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->filter = $container->get('chill.person.export.filter_accompanying_period');
|
$this->filter = static::$container->get('chill.person.export.filter_accompanying_period');
|
||||||
} catch (ServiceNotFoundException $e) {
|
} catch (ServiceNotFoundException $e) {
|
||||||
$this->markTestSkipped("The current configuration does not use accompanying_periods");
|
$this->markTestSkipped("The current configuration does not use accompanying_periods");
|
||||||
}
|
}
|
||||||
@ -67,7 +65,7 @@ class AccompanyingPeriodFilterTest extends AbstractFilterTest
|
|||||||
static::bootKernel();
|
static::bootKernel();
|
||||||
}
|
}
|
||||||
|
|
||||||
$em = static::$kernel->getContainer()
|
$em = static::$container
|
||||||
->get('doctrine.orm.entity_manager');
|
->get('doctrine.orm.entity_manager');
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
@ -36,9 +36,7 @@ class BirthdayFilterTest extends AbstractFilterTest
|
|||||||
{
|
{
|
||||||
static::bootKernel();
|
static::bootKernel();
|
||||||
|
|
||||||
$container = static::$kernel->getContainer();
|
$this->filter = static::$container->get('chill.person.export.filter_birthdate');
|
||||||
|
|
||||||
$this->filter = $container->get('chill.person.export.filter_birthdate');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -63,7 +61,7 @@ class BirthdayFilterTest extends AbstractFilterTest
|
|||||||
static::bootKernel();
|
static::bootKernel();
|
||||||
}
|
}
|
||||||
|
|
||||||
$em = static::$kernel->getContainer()
|
$em = static::$container
|
||||||
->get('doctrine.orm.entity_manager');
|
->get('doctrine.orm.entity_manager');
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
@ -43,9 +43,7 @@ class GenderFilterTest extends AbstractFilterTest
|
|||||||
$request->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
$request->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
||||||
$request->getLocale()->willReturn('fr');
|
$request->getLocale()->willReturn('fr');
|
||||||
|
|
||||||
$container = static::$kernel->getContainer();
|
$this->filter = static::$container->get('chill.person.export.filter_gender');
|
||||||
|
|
||||||
$this->filter = $container->get('chill.person.export.filter_gender');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +73,7 @@ class GenderFilterTest extends AbstractFilterTest
|
|||||||
static::bootKernel();
|
static::bootKernel();
|
||||||
}
|
}
|
||||||
|
|
||||||
$em = static::$kernel->getContainer()
|
$em = static::$container
|
||||||
->get('doctrine.orm.entity_manager');
|
->get('doctrine.orm.entity_manager');
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
@ -60,7 +60,7 @@ class PersonVoterTest extends KernelTestCase
|
|||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
static::bootKernel();
|
static::bootKernel();
|
||||||
$this->voter = static::$kernel->getContainer()
|
$this->voter = static::$container
|
||||||
->get('chill.person.security.authorization.person');
|
->get('chill.person.security.authorization.person');
|
||||||
$this->prophet = new \Prophecy\Prophet();
|
$this->prophet = new \Prophecy\Prophet();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user