mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
tests/ChillPersonBundle: in sf4 container is a static method of KernelTestCase
This commit is contained in:
parent
e4e2138765
commit
f02d6df262
@ -36,12 +36,6 @@ class PickPersonTypeTest extends KernelTestCase
|
|||||||
*/
|
*/
|
||||||
protected $user;
|
protected $user;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @var \Symfony\Component\DependencyInjection\ContainerInterface
|
|
||||||
*/
|
|
||||||
protected $container;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var \Symfony\Component\Form\FormFactoryInterface
|
* @var \Symfony\Component\Form\FormFactoryInterface
|
||||||
@ -52,16 +46,14 @@ class PickPersonTypeTest extends KernelTestCase
|
|||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->container = self::$kernel->getContainer();
|
$this->user = self::$container->get('doctrine.orm.entity_manager')
|
||||||
|
|
||||||
$this->user = $this->container->get('doctrine.orm.entity_manager')
|
|
||||||
->getRepository('ChillMainBundle:User')
|
->getRepository('ChillMainBundle:User')
|
||||||
->findOneBy(array('username' => 'multi_center'));
|
->findOneBy(array('username' => 'multi_center'));
|
||||||
|
|
||||||
$this->formFactory = $this->container->get('form.factory');
|
$this->formFactory = self::$container->get('form.factory');
|
||||||
|
|
||||||
$token = (new UsernamePasswordToken($this->user, 'password', 'firewall'));
|
$token = (new UsernamePasswordToken($this->user, 'password', 'firewall'));
|
||||||
$this->container->get('security.token_storage')
|
self::$container->get('security.token_storage')
|
||||||
->setToken($token);
|
->setToken($token);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user