本文整理汇总了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();
}
示例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');
}
示例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');
}
示例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);
}
示例5: setUp
public function setUp()
{
static::$kernel = static::createKernel();
static::$kernel->boot();
$this->em = static::$kernel->getContainer()->get('doctrine')->getManager();
$this->order = new Order();
}
示例6: setUp
protected function setUp()
{
static::$kernel = static::createKernel();
static::$kernel->boot();
$this->em = static::$kernel->getContainer()->get('doctrine')->getEntityManager();
$this->order = $this->createOrder();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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());
}
示例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');
}
示例14: tearDown
protected function tearDown()
{
$this->truncateTables();
$this->nullifyProperties();
parent::tearDown();
static::$kernel = null;
}
示例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');
}