当前位置: 首页>>代码示例>>PHP>>正文


PHP DatabaseTestCase::setUp方法代码示例

本文整理汇总了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;
 }
开发者ID:felixonline,项目名称:core,代码行数:33,代码来源:AppTestCase.php

示例2: setUp

 /** init test */
 public function setUp()
 {
     $this->setupDatabase(array('metadata'));
     $this->_models = array('Metadata', 'ItemRevision');
     $this->_daos = array();
     parent::setUp();
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:8,代码来源:MetadataModelTest.php

示例3: setUp

 /** init tests */
 public function setUp()
 {
     $this->setupDatabase(array('default'));
     $this->_models = array('Community', 'Folder', 'User', 'Folderpolicygroup', 'Folderpolicyuser');
     $this->_daos = array();
     parent::setUp();
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:8,代码来源:CommunityModelTest.php

示例4: setUp

 protected function setUp()
 {
     parent::setUp();
     $account = new Ot_Account();
     $this->_account = new Ot_Account();
     //var_dump($this->_account->fetchAll()->toArray());
 }
开发者ID:ncsuwebdev,项目名称:otframework,代码行数:7,代码来源:AccountDatabaseTest.php

示例5: setUp

 /** init test */
 public function setUp()
 {
     $this->enabledModules = array('batchmake');
     parent::setUp();
     $this->setupDatabase(array('default'), 'batchmake');
     // module dataset
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:8,代码来源:TaskModelTest.php

示例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);
 }
开发者ID:Eway,项目名称:zf2-eav,代码行数:13,代码来源:EavTest.php

示例7: setUp

 /** init tests */
 public function setUp()
 {
     $this->setupDatabase(array());
     $this->_models = array('Feedpolicygroup');
     $this->_daos = array();
     parent::setUp();
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:8,代码来源:FeedpolicygroupModelTest.php

示例8: setUp

 /** init tests */
 public function setUp()
 {
     $this->setupDatabase(array());
     $this->_models = array('User');
     $this->_daos = array('User');
     parent::setUp();
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:8,代码来源:UserDaoTest.php

示例9: setUp

 /** set up tests */
 public function setUp()
 {
     $this->setupDatabase(array('default'), 'statistics');
     $this->enabledModules = array('scheduler', 'statistics');
     $this->_models = array();
     parent::setUp();
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:8,代码来源:DownloadModelTest.php

示例10: setUp

 public function setUp()
 {
     parent::setUp();
     $this->siteUrls = new SiteUrls();
     $this->api = API::getInstance();
     SiteUrls::clearSitesCache();
 }
开发者ID:a4tunado,项目名称:piwik,代码行数:7,代码来源:SiteUrlsTest.php

示例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');
 }
开发者ID:a4tunado,项目名称:piwik,代码行数:7,代码来源:APITest.php

示例12: setUp

 /** init tests */
 public function setUp()
 {
     $this->setupDatabase(array());
     $this->_models = array('Feed');
     $this->_daos = array('Feed', 'Community', 'Item', 'User', 'ItemRevision');
     parent::setUp();
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:8,代码来源:FeedDaoTest.php

示例13: setUp

 /** init test */
 public function setUp()
 {
     $this->setupDatabase(array('default'));
     $this->_models = array('Assetstore');
     $this->_daos = array();
     parent::setUp();
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:8,代码来源:AssetstoreModelTest.php

示例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();
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:9,代码来源:ItemModelTest.php

示例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');
 }
开发者ID:utlib,项目名称:ojs,代码行数:11,代码来源:LucenePluginTest.php


注:本文中的DatabaseTestCase::setUp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。