本文整理汇总了PHP中Symfony\Bundle\FrameworkBundle\Test\WebTestCase::setUpBeforeClass方法的典型用法代码示例。如果您正苦于以下问题:PHP WebTestCase::setUpBeforeClass方法的具体用法?PHP WebTestCase::setUpBeforeClass怎么用?PHP WebTestCase::setUpBeforeClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Bundle\FrameworkBundle\Test\WebTestCase
的用法示例。
在下文中一共展示了WebTestCase::setUpBeforeClass方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUpBeforeClass
public static function setUpBeforeClass()
{
self::$client = static::createClient();
self::$router = self::$kernel->getContainer()->get('router');
self::$rootDir = self::$kernel->getContainer()->getParameter('kernel.root_dir');
parent::setUpBeforeClass();
}
示例2: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
if (null === static::$kernel) {
static::$kernel = static::createKernel();
}
static::$kernel->boot();
static::$kernel->getContainer()->get('request')->setLocale('en_EN');
static::$em = static::$kernel->getContainer()->get('doctrine.orm.entity_manager');
static::$translator = static::$kernel->getContainer()->get('translator');
$schemaTool = new SchemaTool(static::$em);
static::$metadata = static::$em->getMetadataFactory()->getAllMetadata();
}
示例3: setUpBeforeClass
/**
* @throws \Doctrine\ORM\Tools\ToolsException
*/
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
static::$kernel = static::createKernel(array());
static::$kernel->boot();
$metadata = static::getMetadata();
$tool = new SchemaTool(static::$em);
$tool->dropDatabase();
$tool->createSchema($metadata);
$validator = new SchemaValidator(static::$em);
$errors = $validator->validateMapping();
static::assertCount(0, $errors, implode("\n\n", array_map(function ($l) {
return implode("\n\n", $l);
}, $errors)));
}
示例4: setUpBeforeClass
/**
* Set up before the class
*/
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
// Setup test db
system(dirname(__FILE__) . '/../dbSetup.sh');
}
示例5: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
static::loadDatabase();
}