当前位置: 首页>>代码示例>>PHP>>正文


PHP static::kernel方法代码示例

本文整理汇总了PHP中static::kernel方法的典型用法代码示例。如果您正苦于以下问题:PHP static::kernel方法的具体用法?PHP static::kernel怎么用?PHP static::kernel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在static的用法示例。


在下文中一共展示了static::kernel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testDisplay

 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();
 }
开发者ID:ranjiva,项目名称:Elmet,代码行数:31,代码来源:CurtainsControllerTest.php

示例2: setUp

 /**
  * 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');
 }
开发者ID:unpetitlu,项目名称:store,代码行数:10,代码来源:ProductRepositoryTest.php

示例3: setUp

 /**
  * {@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');
 }
开发者ID:artscorestudio,项目名称:user-bundle,代码行数:11,代码来源:UserManagerTest.php

示例4: setUp

 protected function setUp()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     $this->em = static::$kernel->getContainer()->get('doctrine')->getEntityManager();
     $this->testimonial = $this->createTestimonial($this->em);
 }
开发者ID:ranjiva,项目名称:Elmet,代码行数:7,代码来源:TestimonialControllerTest.php

示例5: setUp

 public function setUp()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     $this->em = static::$kernel->getContainer()->get('doctrine')->getManager();
     $this->order = new Order();
 }
开发者ID:janjango,项目名称:karis-order-invoice,代码行数:7,代码来源:OrderTest.php

示例6: setUp

 protected function setUp()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     $this->em = static::$kernel->getContainer()->get('doctrine')->getEntityManager();
     $this->order = $this->createOrder();
 }
开发者ID:ranjiva,项目名称:Elmet,代码行数:7,代码来源:DeliveryControllerTest.php

示例7: setUp

 public function setUp()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     $this->dm = static::$kernel->getContainer()->get('doctrine.odm.mongodb.document_manager');
     parent::setUp();
 }
开发者ID:Nameless0ne,项目名称:Aisel,代码行数:7,代码来源:AbstractKernelTestCase.php

示例8: __construct

 /**
  * __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();
 }
开发者ID:videni,项目名称:MEFSocketBundle,代码行数:14,代码来源:ApplicationTestCase.php

示例9: setUp

 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, "ranjiva.prasad@gmail.com", "R K Prasad", "GU51 3UP", "Paid");
     $this->trackingDetails[] = $this->createOrderTracking($this->em, "ranjiva.prasad@gmail.com", "S Prasad", "GU51 2TL", "Paid");
     $this->trackingDetails[] = $this->createOrderTracking($this->em, "orders@elmetcurtains.co.uk", "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();
 }
开发者ID:ranjiva,项目名称:Elmet,代码行数:26,代码来源:OrderTrackingControllerTest.php

示例10: setUp

 /**
  * {@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();
 }
开发者ID:dstansby,项目名称:camdram,代码行数:10,代码来源:RepositoryTestCase.php

示例11: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     $_SERVER['HTTP_HOST'] = 'test.com';
     //mock $_SERVER['HTTP_HOST'] for http request testing
     static::$kernel = static::createKernel();
     static::$kernel->boot();
 }
开发者ID:ccq18,项目名称:EduSoho,代码行数:7,代码来源:BaseTestCase.php

示例12: setUp

 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());
 }
开发者ID:nfouka,项目名称:jobbet_sf2.5,代码行数:35,代码来源:ApiControllerTest.php

示例13: setUp

 /**
  * {@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');
 }
开发者ID:syseleven,项目名称:powerdnsbundle,代码行数:10,代码来源:RecordWorkflowTest.php

示例14: tearDown

 protected function tearDown()
 {
     $this->truncateTables();
     $this->nullifyProperties();
     parent::tearDown();
     static::$kernel = null;
 }
开发者ID:supportyard,项目名称:framework-bundle,代码行数:7,代码来源:FunctionalTestCase.php

示例15: setUp

 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');
 }
开发者ID:CatalinaO,项目名称:trip-planner,代码行数:7,代码来源:CreateCompleteTripIntegrationTest.php


注:本文中的static::kernel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。