本文整理汇总了PHP中DatabaseTestCase::setUp方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseTestCase::setUp方法的具体用法?PHP DatabaseTestCase::setUp怎么用?PHP DatabaseTestCase::setUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DatabaseTestCase
的用法示例。
在下文中一共展示了DatabaseTestCase::setUp方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
parent::setUp();
// create app
$config = $this->appConfig + array('base_url' => 'http://localhost/');
$app = new \FelixOnline\Core\App($config);
$dbuser = getenv('DB_USER') ? getenv('DB_USER') : 'root';
$dbpass = getenv('DB_PASS') ? getenv('DB_PASS') : '';
$db = new \ezSQL_mysqli();
$db->quick_connect($dbuser, $dbpass, 'test_media_felix', 'localhost', 3306, 'utf8');
$app['db'] = $db;
$app['safesql'] = new \SafeSQL_MySQLi($db->dbh);
$app['env'] = \FelixOnline\Core\Environment::mock();
// Initialize Akismet
$connector = new \Riv\Service\Akismet\Connector\Test();
$app['akismet'] = new \Riv\Service\Akismet\Akismet($connector);
// Initialize email
$transport = \Swift_NullTransport::newInstance();
$app['email'] = \Swift_Mailer::newInstance($transport);
$session = $this->mock('FelixOnline\\Core\\Session')->getId(1)->start(1)->reset()->new();
$this->reflect($session)->__set('session', array());
$app['env']['session'] = $session;
$cookies = $this->mock('FelixOnline\\Core\\Cookies')->set(true)->delete(true)->new();
$this->reflect($cookies)->__set('cookies', array());
$app['env']['cookies'] = $cookies;
if ($this->setCurrentUser) {
$app['currentuser'] = new \FelixOnline\Core\CurrentUser();
}
// Set empty cache so data isn't cached in tests
$app['cache'] = new \Stash\Pool();
$app->run();
$this->app = $app;
}
示例2: setUp
/** init test */
public function setUp()
{
$this->setupDatabase(array('metadata'));
$this->_models = array('Metadata', 'ItemRevision');
$this->_daos = array();
parent::setUp();
}
示例3: setUp
/** init tests */
public function setUp()
{
$this->setupDatabase(array('default'));
$this->_models = array('Community', 'Folder', 'User', 'Folderpolicygroup', 'Folderpolicyuser');
$this->_daos = array();
parent::setUp();
}
示例4: setUp
protected function setUp()
{
parent::setUp();
$account = new Ot_Account();
$this->_account = new Ot_Account();
//var_dump($this->_account->fetchAll()->toArray());
}
示例5: setUp
/** init test */
public function setUp()
{
$this->enabledModules = array('batchmake');
parent::setUp();
$this->setupDatabase(array('default'), 'batchmake');
// module dataset
}
示例6: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
parent::setUp();
$entityTable = new TableGateway('eav_entity', Bootstrap::adapter());
$this->_entityTable = $entityTable;
$this->_eav = new Eav($entityTable);
}
示例7: setUp
/** init tests */
public function setUp()
{
$this->setupDatabase(array());
$this->_models = array('Feedpolicygroup');
$this->_daos = array();
parent::setUp();
}
示例8: setUp
/** init tests */
public function setUp()
{
$this->setupDatabase(array());
$this->_models = array('User');
$this->_daos = array('User');
parent::setUp();
}
示例9: setUp
/** set up tests */
public function setUp()
{
$this->setupDatabase(array('default'), 'statistics');
$this->enabledModules = array('scheduler', 'statistics');
$this->_models = array();
parent::setUp();
}
示例10: setUp
public function setUp()
{
parent::setUp();
$this->siteUrls = new SiteUrls();
$this->api = API::getInstance();
SiteUrls::clearSitesCache();
}
示例11: setUp
public function setUp()
{
parent::setUp();
$this->api = API::getInstance();
Fixture::createWebsite('2014-01-01 00:00:00');
Fixture::createWebsite('2014-01-01 00:00:00');
}
示例12: setUp
/** init tests */
public function setUp()
{
$this->setupDatabase(array());
$this->_models = array('Feed');
$this->_daos = array('Feed', 'Community', 'Item', 'User', 'ItemRevision');
parent::setUp();
}
示例13: setUp
/** init test */
public function setUp()
{
$this->setupDatabase(array('default'));
$this->_models = array('Assetstore');
$this->_daos = array();
parent::setUp();
}
示例14: setUp
/** init tests */
public function setUp()
{
$this->setupDatabase(array());
$this->enabledModules = array();
$this->_models = array('Bitstream', 'Item', 'ItemRevision', 'User');
$this->_daos = array('Item');
parent::setUp();
}
示例15: setUp
/**
* @see PKPTestCase::setUp()
*/
protected function setUp()
{
parent::setUp();
// Instantiate the plug-in for testing.
$this->mockRequest();
PluginRegistry::loadCategory('generic', true, 0);
$this->lucenePlugin = PluginRegistry::getPlugin('generic', 'luceneplugin');
}