Example #1
0
 public function testDisplay()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     $em = static::$kernel->getContainer()->get('doctrine')->getEntityManager();
     $query = $em->createQuery("SELECT cd from ElmetSiteBundle:CurtainDesign cd WHERE cd.url_name='daisy_chain' or cd.url_name='geneva'");
     $curtainDesigns = $query->getResult();
     foreach ($curtainDesigns as $curtainDesign) {
         $curtainDesign->setPosition(-1);
         $em->merge($curtainDesign);
     }
     $em->flush();
     $client = static::createClient();
     $crawler = $client->request('GET', '/curtains');
     $this->assertTrue($crawler->filter('html:contains("Daisy Chain")')->count() > 0);
     $this->assertTrue($crawler->filter('html:contains("Geneva")')->count() > 0);
     foreach ($curtainDesigns as $curtainDesign) {
         $curtainDesign->setDisplay(0);
         $em->merge($curtainDesign);
     }
     $em->flush();
     $crawler = $client->request('GET', '/curtains');
     $this->assertTrue($crawler->filter('html:contains("Daisy Chain")')->count() == 0);
     $this->assertTrue($crawler->filter('html:contains("Geneva")')->count() == 0);
     foreach ($curtainDesigns as $curtainDesign) {
         $curtainDesign->setPosition(0);
         $curtainDesign->setDisplay(1);
         $em->merge($curtainDesign);
     }
     $em->flush();
 }
 /**
  * Setup Doctrine Entity Manger
  */
 public function setUp()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     //je recupere
     $this->em = static::$kernel->getContainer()->get('doctrine.orm.entity_manager');
 }
 /**
  * {@inheritDoc}
  * @see PHPUnit_Framework_TestCase::setUp()
  */
 public function setUp()
 {
     parent::setUp();
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     $this->entityManager = self::$kernel->getContainer()->get('asf_user.user.manager');
 }
 protected function setUp()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     $this->em = static::$kernel->getContainer()->get('doctrine')->getEntityManager();
     $this->testimonial = $this->createTestimonial($this->em);
 }
 public function setUp()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     $this->em = static::$kernel->getContainer()->get('doctrine')->getManager();
     $this->order = new Order();
 }
Example #6
0
 protected function setUp()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     $this->em = static::$kernel->getContainer()->get('doctrine')->getEntityManager();
     $this->order = $this->createOrder();
 }
 public function setUp()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     $this->dm = static::$kernel->getContainer()->get('doctrine.odm.mongodb.document_manager');
     parent::setUp();
 }
 /**
  * __construct function.
  * 
  * @access public
  * @param mixed $name (default: null)
  * @return void
  */
 public function __construct($name = null)
 {
     parent::__construct($name);
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     static::$container = static::$kernel->getContainer();
 }
 protected function setUp()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     $this->em = static::$kernel->getContainer()->get('doctrine')->getEntityManager();
     $this->trackingDetails = array();
     $this->trackingDetails[] = $this->createOrderTracking($this->em, "*****@*****.**", "R K Prasad", "GU51 3UP", "Paid");
     $this->trackingDetails[] = $this->createOrderTracking($this->em, "*****@*****.**", "S Prasad", "GU51 2TL", "Paid");
     $this->trackingDetails[] = $this->createOrderTracking($this->em, "*****@*****.**", "T Prasad", "GU51 3UP", "Paid");
     $repository = $this->em->getRepository('ElmetAdminBundle:Batch');
     $this->oldCurrentBatch = $repository->findOneBy(array('batch_status' => 'Current'));
     $this->oldNextBatch = $repository->findOneBy(array('batch_status' => 'Next'));
     $this->oldCurrentBatch->setBatchStatus('Closed');
     $this->oldNextBatch->setBatchStatus('Closed');
     $this->em->merge($this->oldCurrentBatch);
     $this->em->merge($this->oldNextBatch);
     $this->newCurrentBatch = new Batch();
     $this->newCurrentBatch->setNextItemId(1);
     $this->newCurrentBatch->setBatchStatus('Current');
     $this->newNextBatch = new Batch();
     $this->newNextBatch->setNextItemId(1);
     $this->newNextBatch->setBatchStatus('Next');
     $this->em->persist($this->newCurrentBatch);
     $this->em->persist($this->newNextBatch);
     $this->em->flush();
 }
Example #10
0
 /**
  * {@inheritDoc}
  */
 public function setUp()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     $this->em = static::$kernel->getContainer()->get('doctrine')->getManager();
     static::$kernel->getContainer()->get('acts_camdram_backend.database_tools')->resetDatabase();
 }
Example #11
0
 public static function setUpBeforeClass()
 {
     $_SERVER['HTTP_HOST'] = 'test.com';
     //mock $_SERVER['HTTP_HOST'] for http request testing
     static::$kernel = static::createKernel();
     static::$kernel->boot();
 }
Example #12
0
 public function setUp()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     $this->application = new Application(static::$kernel);
     // drop the database
     $command = new DropDatabaseDoctrineCommand();
     $this->application->add($command);
     $input = new ArrayInput(array('command' => 'doctrine:database:drop', '--force' => true));
     $command->run($input, new NullOutput());
     // we have to close the connection after dropping the database so we don't get "No database selected" error
     $connection = $this->application->getKernel()->getContainer()->get('doctrine')->getConnection();
     if ($connection->isConnected()) {
         $connection->close();
     }
     // create the database
     $command = new CreateDatabaseDoctrineCommand();
     $this->application->add($command);
     $input = new ArrayInput(array('command' => 'doctrine:database:create'));
     $command->run($input, new NullOutput());
     // create schema
     $command = new CreateSchemaDoctrineCommand();
     $this->application->add($command);
     $input = new ArrayInput(array('command' => 'doctrine:schema:create'));
     $command->run($input, new NullOutput());
     // get the Entity Manager
     $this->em = static::$kernel->getContainer()->get('doctrine')->getManager();
     // load fixtures
     $client = static::createClient();
     $loader = new \Symfony\Bridge\Doctrine\DataFixtures\ContainerAwareLoader($client->getContainer());
     $loader->loadFromDirectory(static::$kernel->locateResource('@ErlemJobeetBundle/DataFixtures/ORM'));
     $purger = new \Doctrine\Common\DataFixtures\Purger\ORMPurger($this->em);
     $executor = new \Doctrine\Common\DataFixtures\Executor\ORMExecutor($this->em, $purger);
     $executor->execute($loader->getFixtures());
 }
 /**
  * {@inheritDoc}
  */
 public function setUp()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     $this->container = static::$kernel->getContainer();
     $this->workflow = static::$kernel->getContainer()->get('syseleven.pdns.workflow.records');
 }
 protected function tearDown()
 {
     $this->truncateTables();
     $this->nullifyProperties();
     parent::tearDown();
     static::$kernel = null;
 }
 public function setUp()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     $this->em = static::$kernel->getContainer()->get('doctrine')->getManager();
     $this->commandHandler = static::$kernel->getContainer()->get('command_handler');
 }
 public function setUp()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     $this->em = static::$kernel->getContainer()->get('doctrine')->getManager();
     $this->repo = new TripRepository($this->em);
 }
Example #17
0
 public function setUp()
 {
     $this->loadFixtures(array());
     // init kernel to init entity manager
     static::$kernel = static::createKernel(array('environment' => 'test'));
     static::$kernel->boot();
 }
 /**
  * Set up test
  */
 public function setUp()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     static::$application = new Application(static::$kernel);
     static::$application->setAutoExit(false);
 }
 protected function getContainer(array $options = array())
 {
     if (!static::$kernel) {
         static::$kernel = static::createKernel($options);
     }
     static::$kernel->boot();
     return static::$kernel->getContainer();
 }
 private static function initKernel()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     static::$container = static::$kernel->getContainer();
     static::$doctrine = static::$container->get('doctrine');
     static::$om = static::$doctrine->getManager();
 }
Example #21
0
 /**
  * @return \Symfony\Component\HttpKernel\KernelInterface
  */
 protected static function getKernel()
 {
     if (null === static::$kernel) {
         static::$kernel = static::createKernel();
         static::$kernel->boot();
     }
     return static::$kernel;
 }
Example #22
0
 public function __construct($debug = false)
 {
     $this->debug = $debug;
     $this->rootPath = $this->getRootPath();
     $this->initialize();
     $this->dispatchEvent(EventStore::KERNEL_INITED);
     static::$kernel = $this;
 }
 public function setUp()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     $this->em = static::$kernel->getContainer()->get('doctrine.orm.entity_manager');
     // Add data with Fixtures to include post listings
     $this->loadFixtures(array('Manhattan\\Bundle\\PostsBundle\\Tests\\DataFixtures\\ORM\\FixtureLoader'));
 }
Example #24
0
 public function setUp()
 {
     $this->loadFixtures(array());
     // init kernel to init entity manager
     static::$kernel = static::createKernel(array('environment' => 'test'));
     static::$kernel->boot();
     $this->em = static::$kernel->getContainer()->get('doctrine')->getManager();
 }
Example #25
0
 /**
  * Creates a Client.
  *
  * @param array   $options An array of options to pass to the createKernel class
  * @param array   $server  An array of server parameters
  *
  * @return Client A Client instance
  */
 protected static function createClient(array $options = array(), array $server = array())
 {
     static::$kernel = static::createKernel($options);
     static::$kernel->boot();
     $client = static::$kernel->getContainer()->get('test.client');
     $client->setServerParameters($server);
     return $client;
 }
 /**
  *
  */
 public function setUp()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     static::$application = new Application(static::$kernel);
     static::addDoctrineCommands();
     static::rebuildDatabase();
 }
Example #27
0
 /**
  * @param  array              $options Kernel options
  * @return ContainerInterface
  */
 public static function getContainer(array $options = [])
 {
     if (null === static::$kernel) {
         static::$kernel = static::createKernel($options);
     }
     static::$kernel->boot();
     return static::$kernel->getContainer();
 }
Example #28
0
 protected function setUp()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     $this->indexer = static::$kernel->getContainer()->get('qimnet.solr.indexer');
     $this->em = self::$kernel->getContainer()->get('doctrine.orm.entity_manager');
     $this->client = self::$kernel->getContainer()->get('qimnet.solr.client');
 }
 public function setUp()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     $this->em = static::$kernel->getContainer()->get('doctrine.orm.entity_manager');
     // Add data with Fixtures
     $this->loadFixtures(array('Manhattan\\Bundle\\ConsoleBundle\\Tests\\DataFixtures\\ORM\\LoadAuthenticatedAdminUserData', 'Manhattan\\Bundle\\PostsBundle\\Tests\\DataFixtures\\ORM\\FixtureLoader'));
 }
 public function setUp()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     $this->em = static::$kernel->getContainer()->get('doctrine.orm.entity_manager');
     $this->em->beginTransaction();
     $this->repo = $this->em->getRepository("BdEWeiBundle:Config");
 }