mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix some tests in main bundle
This commit is contained in:
parent
1b42656e0f
commit
e98a5b88aa
@ -34,7 +34,7 @@ trait PrepareClientTrait
|
|||||||
* @return \Symfony\Component\BrowserKit\Client
|
* @return \Symfony\Component\BrowserKit\Client
|
||||||
* @throws \LogicException
|
* @throws \LogicException
|
||||||
*/
|
*/
|
||||||
public function getClient(
|
public function getClientAuthenticated(
|
||||||
$username = 'center a_social',
|
$username = 'center a_social',
|
||||||
$password = 'password'
|
$password = 'password'
|
||||||
) {
|
) {
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Chill\MainBundle\Tests\Controller;
|
|
||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
|
||||||
|
|
||||||
class DefaultControllerTest extends WebTestCase
|
|
||||||
{
|
|
||||||
public function testIndex()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -45,11 +45,6 @@ class ExportManagerTest extends KernelTestCase
|
|||||||
use \Chill\MainBundle\Test\PrepareUserTrait;
|
use \Chill\MainBundle\Test\PrepareUserTrait;
|
||||||
use \Chill\MainBundle\Test\PrepareScopeTrait;
|
use \Chill\MainBundle\Test\PrepareScopeTrait;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @var \Symfony\Component\DependencyInjection\ContainerInterface
|
|
||||||
*/
|
|
||||||
private $container;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -65,8 +60,6 @@ class ExportManagerTest extends KernelTestCase
|
|||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->container = self::$kernel->getContainer();
|
|
||||||
|
|
||||||
$this->prophet = new \Prophecy\Prophet;
|
$this->prophet = new \Prophecy\Prophet;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,7 +90,7 @@ class ExportManagerTest extends KernelTestCase
|
|||||||
\Symfony\Component\Security\Core\User\UserInterface $user = null
|
\Symfony\Component\Security\Core\User\UserInterface $user = null
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$localUser = $user === NULL ? $this->container->get('doctrine.orm.entity_manager')
|
$localUser = $user === NULL ? self::$container->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('ChillMainBundle:User')
|
->getRepository('ChillMainBundle:User')
|
||||||
->findOneBy(array('username' => 'center a_social')) :
|
->findOneBy(array('username' => 'center a_social')) :
|
||||||
$user;
|
$user;
|
||||||
@ -106,10 +99,10 @@ class ExportManagerTest extends KernelTestCase
|
|||||||
$tokenStorage->setToken($token);
|
$tokenStorage->setToken($token);
|
||||||
|
|
||||||
return new ExportManager(
|
return new ExportManager(
|
||||||
$logger === NULL ? $this->container->get('logger') : $logger,
|
$logger === NULL ? self::$container->get('logger') : $logger,
|
||||||
$em === NULL ? $this->container->get('doctrine.orm.entity_manager') : $em,
|
$em === NULL ? self::$container->get('doctrine.orm.entity_manager') : $em,
|
||||||
$authorizationChecker === NULL ? $this->container->get('security.authorization_checker') : $authorizationChecker,
|
$authorizationChecker === NULL ? self::$container->get('security.authorization_checker') : $authorizationChecker,
|
||||||
$authorizationHelper === NULL ? $this->container->get('chill.main.security.authorization.helper') : $authorizationHelper,
|
$authorizationHelper === NULL ? self::$container->get('chill.main.security.authorization.helper') : $authorizationHelper,
|
||||||
$tokenStorage)
|
$tokenStorage)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
@ -544,7 +537,7 @@ class ExportManagerTest extends KernelTestCase
|
|||||||
|
|
||||||
$export = $this->prophet->prophesize();
|
$export = $this->prophet->prophesize();
|
||||||
$export->willImplement(ExportInterface::class);
|
$export->willImplement(ExportInterface::class);
|
||||||
$em = $this->container->get('doctrine.orm.entity_manager');
|
$em = self::$container->get('doctrine.orm.entity_manager');
|
||||||
$export->initiateQuery(
|
$export->initiateQuery(
|
||||||
Argument::is(array('foo')),
|
Argument::is(array('foo')),
|
||||||
Argument::Type('array'),
|
Argument::Type('array'),
|
||||||
@ -627,7 +620,7 @@ class ExportManagerTest extends KernelTestCase
|
|||||||
|
|
||||||
//add formatter interface
|
//add formatter interface
|
||||||
$formatter = new \Chill\MainBundle\Export\Formatter\SpreadSheetFormatter(
|
$formatter = new \Chill\MainBundle\Export\Formatter\SpreadSheetFormatter(
|
||||||
$this->container->get('translator'), $exportManager);
|
self::$container->get('translator'), $exportManager);
|
||||||
$exportManager->addFormatter($formatter, 'spreadsheet');
|
$exportManager->addFormatter($formatter, 'spreadsheet');
|
||||||
|
|
||||||
//ob_start();
|
//ob_start();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user