當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。