本文整理汇总了PHP中ezpDatabaseTestCase::setUp方法的典型用法代码示例。如果您正苦于以下问题:PHP ezpDatabaseTestCase::setUp方法的具体用法?PHP ezpDatabaseTestCase::setUp怎么用?PHP ezpDatabaseTestCase::setUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ezpDatabaseTestCase
的用法示例。
在下文中一共展示了ezpDatabaseTestCase::setUp方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
/**
* Test case setup
*/
public function setUp()
{
parent::setUp();
$this->wildcard = new eZURLWildcard(array('source_url' => 'MyRootURL', 'destination_url' => '/', 'type' => eZURLWildcard::TYPE_DIRECT));
$this->wildcard->store();
eZURLWildcard::expireCache();
}
示例2: setUp
/**
* Test setup
*
* Load an instance of file.ini
* Assigns DB parameters for cluster
**/
public function setUp()
{
if (!$this->sharedFixture instanceof eZMySQLDB) {
self::markTestSkipped("Not using mysql interface, skipping");
}
parent::setUp();
// We need to clear the existing handler if it was loaded before the INI
// settings changes
if (isset($GLOBALS['eZClusterFileHandler_chosen_handler']) and !$GLOBALS['eZClusterFileHandler_chosen_handler'] instanceof eZDFSFileHandler) {
unset($GLOBALS['eZClusterFileHandler_chosen_handler']);
}
// Load database parameters for cluster
// The same DSN than the relational database is used
$fileINI = eZINI::instance('file.ini');
$this->previousFileHandler = $fileINI->variable('ClusteringSettings', 'FileHandler');
$fileINI->setVariable('ClusteringSettings', 'FileHandler', 'eZDFSFileHandler');
$dsn = ezpTestRunner::dsn()->parts;
$fileINI->setVariable('eZDFSClusteringSettings', 'DBHost', $dsn['host']);
$fileINI->setVariable('eZDFSClusteringSettings', 'DBPort', $dsn['port']);
$fileINI->setVariable('eZDFSClusteringSettings', 'DBSocket', $dsn['socket']);
$fileINI->setVariable('eZDFSClusteringSettings', 'DBName', $dsn['database']);
$fileINI->setVariable('eZDFSClusteringSettings', 'DBUser', $dsn['user']);
$fileINI->setVariable('eZDFSClusteringSettings', 'DBPassword', $dsn['password']);
$fileINI->setVariable('eZDFSClusteringSettings', 'MountPointPath', $this->DFSPath);
if (!file_exists($this->DFSPath)) {
eZDir::doMkdir($this->DFSPath, 0755);
$this->haveToRemoveDFSPath = true;
}
ezpTestDatabaseHelper::insertSqlData($this->sharedFixture, $this->sqlFiles);
$this->db = $this->sharedFixture;
}
示例3: setUp
protected function setUp()
{
if (!in_array(ezpTestRunner::dsn()->dbsyntax, array('mysql', 'mysqli'))) {
self::markTestSkipped("Not running MySQL nor MysQLi, skipping");
}
parent::setUp();
}
示例4: setUp
public function setUp()
{
parent::setUp();
$this->xxx = eZContentLanguage::addLanguage('xxx-XX', 'XXXX');
ezpINIHelper::setINISetting('site.ini', 'RegionalSettings', 'SiteLanguageList', array('xxx-XX', 'eng-GB'));
eZContentLanguage::clearPrioritizedLanguages();
}
示例5: setUp
/**
* Test case setup
* Changes INI settings that affect eZURLWildcard to known and predictable
* values
*/
public function setUp()
{
parent::setUp();
$this->wildcardRow[0] = array(
'source_url' => 'test/*',
'destination_url' => '/',
'type' => eZURLWildcard::TYPE_DIRECT,
);
$this->wildcards[0] = new eZURLWildcard( $this->wildcardRow[0] );
$this->generatedWildcards = 5;
// Creating some wildcards
for ( $i = 0; $i < $this->generatedWildcards; ++$i )
{
$source = "test" . ( $i % 2 ? 'Odd' : 'Pair' ) . "/$i/*";
$this->wildcardObjects[$source] = self::createWildcard( $source, '/', eZURLWildcard::TYPE_DIRECT );
}
// Creating some wildcards which will be used for translate tests
$this->wildcardObjects["foobar/*/*"] = self::createWildcard( "foobar/*/*", '/', eZURLWildcard::TYPE_DIRECT );
$this->wildcardObjects["testTranslate1/*/*"] = self::createWildcard( "testTranslate1/*/*", 'foobar/{1}/{2}', eZURLWildcard::TYPE_DIRECT );
$this->wildcardObjects["testTranslate2/*/abc"] = self::createWildcard( "testTranslate2/*/abc", 'foobar/{1}', eZURLWildcard::TYPE_FORWARD );
$this->wildcardObjects["test/single-page"] = self::createWildcard( "test/single-page", 'foo/bar', eZURLWildcard::TYPE_FORWARD );
eZURLWildcard::expireCache();
}
示例6: setUp
public function setUp()
{
parent::setUp();
$this->userLogin = uniqid( '', true );
$this->userEmail = "{$this->userLogin}@ez.no";
$ini = eZINI::instance();
$params = array(
'creator_id' => 14,
'class_identifier' => 'user',
'parent_node_id' => $ini->variable( 'UserSettings', 'DefaultUserPlacement' ),
'attributes' => array(
'first_name' => 'foo',
'last_name' => 'bar' ),
);
$contentObject = eZContentFunctions::createAndPublishObject( $params );
if( !$contentObject instanceof eZContentObject )
{
die( 'Impossible to create user object' );
}
$this->userObject = $contentObject;
}
示例7: setUp
public function setUp()
{
parent::setUp();
self::$qb = new ezfeZPSolrQueryBuilderTester();
self::$findINI = eZINI::instance('ezfind.ini');
self::$siteINI = eZINI::instance('site.ini');
}
示例8: setUp
public function setUp()
{
$className = 'eZSolrMultiCoreBase';
if (!class_exists($className)) {
$this->markTestSkipped("The class '{$className}' doesn't exist.");
}
parent::setUp();
}
示例9: setUp
public function setUp()
{
// Enabled delayed indexing in order not to index support objects
// ( the ones used for testing ezfSolrDocumentFieldObjectRelation::getData() for instance )
$siteINI = eZINI::instance('site.ini');
$siteINI->setVariable('SearchSettings', 'DelayedIndexing', 'enabled');
parent::setUp();
}
示例10: setUp
/**
* setUp():
* - creates a PAEX object for the admin user
**/
public function setUp()
{
parent::setUp();
$this->paexTime = time();
$row = array('contentobject_id' => 14, 'passwordvalidationregexp' => '', 'passwordlifetime' => 3, 'expirationnotification' => eZPaEx::NOT_DEFINED, 'password_last_updated' => $this->paexTime, 'updatechildren' => 0, 'expirationnotification_sent' => 0);
$this->paex = new eZPaEx($row);
$this->paexINI = eZINI::instance('mbpaex.ini');
}
示例11: setUp
public function setUp()
{
parent::setUp();
$imageClass = new ezpClass(self::CLASS_IDENTIFIER, self::CLASS_IDENTIFIER, "<name>");
$imageClass->add("Name", "name", "ezstring");
$imageClass->add("Image", "image", "ezimage");
$imageClass->store();
}
示例12: setUp
public function setUp()
{
// Verify that the clusterClass for each implementation is properly defined
if ($this->clusterClass === false) {
$this->markTestSkipped("Test class " . get_class($this) . " does not provide the clusterClass property");
}
return parent::setUp();
}
示例13: setUp
public function setUp()
{
parent::setUp();
$this->language = eZContentLanguage::addLanguage("nor-NO", "Norsk");
// Make sure all tests are done using utf-8 as charset
$this->charset = $GLOBALS['eZTextCodecInternalCharsetReal'];
$GLOBALS['eZTextCodecInternalCharsetReal'] = 'utf-8';
}
示例14: setUp
protected function setUp()
{
if (ezpTestRunner::dsn()->dbsyntax !== "postgresql") {
self::markTestSkipped("Not running PostgresSQL, skipping");
}
parent::setUp();
ezpTestDatabaseHelper::clean($this->sharedFixture);
}
示例15: setUp
public function setUp()
{
parent::setUp();
$this->article = new ezpObject("article", 2, eZUser::fetchByName('anonymous')->attribute('contentobject_id'));
$this->article->title = "Article for " . __CLASS__;
$this->article->publish();
$this->article->addTranslation("nor-NO", array("title" => "Norsk title of article for " . __CLASS__));
}