當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。