當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DatabaseTest類代碼示例

本文整理匯總了PHP中DatabaseTest的典型用法代碼示例。如果您正苦於以下問題:PHP DatabaseTest類的具體用法?PHP DatabaseTest怎麽用?PHP DatabaseTest使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了DatabaseTest類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: set_up

 public function set_up($connection_name = null)
 {
     if ($connection_name && !in_array($connection_name, PDO::getAvailableDrivers()) || ActiveRecord\Config::instance()->get_connection($connection_name) == 'skip') {
         $this->mark_test_skipped($connection_name . ' drivers are not present');
     }
     parent::set_up($connection_name);
 }
開發者ID:visavi,項目名稱:phpactiverecord,代碼行數:7,代碼來源:AdapterTest.php

示例2: setUp

 function setUp()
 {
     parent::setUp();
     $serial_string = serialize($this->db);
     unset($this->db);
     $this->db = unserialize($serial_string);
 }
開發者ID:neopan,項目名稱:DB_Table,代碼行數:7,代碼來源:SerialTest.php

示例3: setUp

 /**
  * initialite
  */
 public function setUp()
 {
     parent::setUp();
     $this->_model = new Project_Models_Project();
     $this->_tree = new Phprojekt_Tree_Node_Database($this->_model, 1);
     $this->_tree = $this->_tree->setup();
 }
開發者ID:RainyBlueSky,項目名稱:PHProjekt,代碼行數:10,代碼來源:DatabaseTest.php

示例4: setUp

 public function setUp($connection_name = null)
 {
     if ($connection_name && !in_array($connection_name, PDO::getAvailableDrivers())) {
         $this->mark_test_skipped($connection_name . ' drivers are not present');
     }
     parent::setUp($connection_name);
 }
開發者ID:signalrunner,項目名稱:php-activerecord,代碼行數:7,代碼來源:AdapterTest.php

示例5: set_up

 public function set_up($connection_name = null)
 {
     parent::set_up($connection_name);
     // ensure VenueCB model has been loaded
     VenueCB::find(1);
     $this->callback = new ActiveRecord\CallBack('VenueCB');
 }
開發者ID:jhonleandres,項目名稱:batata,代碼行數:7,代碼來源:CallbackTest.php

示例6: set_up

 public function set_up($connection_name = null)
 {
     parent::set_up($connection_name);
     BookValidations::$validates_presence_of[0] = 'name';
     BookValidations::$validates_uniqueness_of[0] = 'name';
     ValuestoreValidations::$validates_uniqueness_of[0] = 'key';
 }
開發者ID:visavi,項目名稱:phpactiverecord,代碼行數:7,代碼來源:ValidationsTest.php

示例7: set_up

 public function set_up($connection_name = null)
 {
     if (!extension_loaded('memcache')) {
         $this->markTestSkipped('The memcache extension is not available');
         return;
     }
     parent::set_up($connection_name);
     ActiveRecord\Config::instance()->set_cache('memcache://localhost');
 }
開發者ID:nehulyadav,項目名稱:php-activerecord,代碼行數:9,代碼來源:CacheModelTest.php

示例8: GetDatabaseConnection

 public static function GetDatabaseConnection()
 {
     // Lazy create the singleton connection
     if (is_null(self::$singletonConnection)) {
         self::$singletonConnection = Database::connect(DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, DATABASE_HOST);
     }
     // Return the singleton connection
     return self::$singletonConnection;
 }
開發者ID:sandyman,項目名稱:postgres-dbal,代碼行數:9,代碼來源:DatabaseTest.php

示例9: setUp

 /**
  * setUp method for PHPUnit. We use a shared db connection
  */
 public function setUp()
 {
     parent::setUp();
     $this->_emptyResult = array();
     $this->_formResult = array('projectId' => array('id' => '', 'tableName' => '', 'tablefield' => '', 'formTab' => '', 'formLabel' => '', 'formType' => '', 'formPosition' => '', 'formColumns' => '', 'formRegexp' => '', 'formRange' => '', 'defaultValue' => '', 'listPosition' => '', 'listAlign' => '', 'listUseFilter' => '', 'altPosition' => '', 'status' => '', 'isInteger' => '', 'isRequired' => '', 'isUnique' => ''), 'title' => array('id' => '', 'tableName' => '', 'tablefield' => '', 'formTab' => '', 'formLabel' => '', 'formType' => '', 'formPosition' => '', 'formColumns' => '', 'formRegexp' => '', 'formRange' => '', 'defaultValue' => '', 'listPosition' => '', 'listAlign' => '', 'listUseFilter' => '', 'altPosition' => '', 'status' => '', 'isInteger' => '', 'isRequired' => '', 'isUnique' => ''), 'notes' => array('id' => '', 'tableName' => '', 'tablefield' => '', 'formTab' => '', 'formLabel' => '', 'formType' => '', 'formPosition' => '', 'formColumns' => '', 'formRegexp' => '', 'formRange' => '', 'defaultValue' => '', 'listPosition' => '', 'listAlign' => '', 'listUseFilter' => '', 'altPosition' => '', 'status' => '', 'isInteger' => '', 'isRequired' => '', 'isUnique' => ''), 'startDate' => array('id' => '', 'tableName' => '', 'tablefield' => '', 'formTab' => '', 'formLabel' => '', 'formType' => '', 'formPosition' => '', 'formColumns' => '', 'formRegexp' => '', 'formRange' => '', 'defaultValue' => '', 'listPosition' => '', 'listAlign' => '', 'listUseFilter' => '', 'altPosition' => '', 'status' => '', 'isInteger' => '', 'isRequired' => '', 'isUnique' => ''), 'endDate' => array('id' => '', 'tableName' => '', 'tablefield' => '', 'formTab' => '', 'formLabel' => '', 'formType' => '', 'formPosition' => '', 'formColumns' => '', 'formRegexp' => '', 'formRange' => '', 'defaultValue' => '', 'listPosition' => '', 'listAlign' => '', 'listUseFilter' => '', 'altPosition' => '', 'status' => '', 'isInteger' => '', 'isRequired' => '', 'isUnique' => ''), 'priority' => array('id' => '', 'tableName' => '', 'tablefield' => '', 'formTab' => '', 'formLabel' => '', 'formType' => '', 'formPosition' => '', 'formColumns' => '', 'formRegexp' => '', 'formRange' => '', 'defaultValue' => '', 'listPosition' => '', 'listAlign' => '', 'listUseFilter' => '', 'altPosition' => '', 'status' => '', 'isInteger' => '', 'isRequired' => '', 'isUnique' => ''), 'currentStatus' => array('id' => '', 'tableName' => '', 'tablefield' => '', 'formTab' => '', 'formLabel' => '', 'formType' => '', 'formPosition' => '', 'formColumns' => '', 'formRegexp' => '', 'formRange' => '', 'defaultValue' => '', 'listPosition' => '', 'listAlign' => '', 'listUseFilter' => '', 'altPosition' => '', 'status' => '', 'isInteger' => '', 'isRequired' => '', 'isUnique' => ''), 'completePercent' => array('id' => '', 'tableName' => '', 'tablefield' => '', 'formTab' => '', 'formLabel' => '', 'formType' => '', 'formPosition' => '', 'formColumns' => '', 'formRegexp' => '', 'formRange' => '', 'defaultValue' => '', 'listPosition' => '', 'listAlign' => '', 'listUseFilter' => '', 'altPosition' => '', 'status' => '', 'isInteger' => '', 'isRequired' => '', 'isUnique' => ''), 'budget' => array('id' => '', 'tableName' => '', 'tablefield' => '', 'formTab' => '', 'formLabel' => '', 'formType' => '', 'formPosition' => '', 'formColumns' => '', 'formRegexp' => '', 'formRange' => '', 'defaultValue' => '', 'listPosition' => '', 'listAlign' => '', 'listUseFilter' => '', 'altPosition' => '', 'status' => '', 'isInteger' => '', 'isRequired' => '', 'isUnique' => ''));
     $this->_listResult = array('title' => $this->_formResult['title'], 'startDate' => $this->_formResult['startDate'], 'endDate' => $this->_formResult['endDate'], 'priority' => $this->_formResult['priority'], 'currentStatus' => $this->_formResult['currentStatus'], 'completePercent' => $this->_formResult['completePercent']);
     $this->_filterResult = array('title' => $this->_formResult['title'], 'start_date' => $this->_formResult['startDate'], 'end_date' => $this->_formResult['endDate'], 'priority' => $this->_formResult['priority'], 'current_status' => $this->_formResult['currentStatus'], 'complete_percent' => $this->_formResult['completePercent']);
     $this->sharedFixture = Phprojekt::getInstance()->getDb();
 }
開發者ID:RainyBlueSky,項目名稱:PHProjekt,代碼行數:12,代碼來源:AbstractTest.php

示例10: setUp

 /**
  * setUp method for PHPUnit. We use a shared db connection
  */
 public function setUp()
 {
     parent::setUp();
     $this->_emptyResult = array();
     $this->_formResult = array('title', 'notes', 'projectId', 'startDate', 'endDate', 'priority', 'currentStatus', 'completePercent', 'budget', 'contactId');
     $this->_formLabelResult = array('Title', 'Notes', 'Parent', 'Start date', 'End date', 'Priority', 'Current status', 'Complete percent', 'Budget', 'Contact');
     $this->_listResult = array('title', 'startDate', 'endDate', 'priority', 'currentStatus', 'completePercent');
     $this->_listLabelResult = array('Title', 'Start date', 'End date', 'Priority', 'Current status', 'Complete percent');
     $this->sharedFixture = Phprojekt::getInstance()->getDb();
 }
開發者ID:RainyBlueSky,項目名稱:PHProjekt,代碼行數:13,代碼來源:DatabaseManagerTest.php

示例11: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     @chmod(__DIR__, 0775);
     @mkdir(__DIR__ . '/data', 0775, true);
     // DON'T put this in create
     // create db
     self::$db = new Database(__DIR__ . '/data');
     self::$db->guid = self::guid();
     // create index
     self::$guidIndex = new Index(self::$db, 'guid', 'guid');
     // random delay for concurrent testing
     usleep(rand(0, 100));
 }
開發者ID:morris,項目名稱:microdb,代碼行數:13,代碼來源:DatabaseTest.php

示例12: setUp

 public function setUp($connectionName = null)
 {
     parent::setUp($connectionName);
     Event::$belongsTo = array(array('venue'), array('host'));
     Venue::$hasMany = array(array('events', 'order' => 'id asc'), array('hosts', 'through' => 'events', 'order' => 'hosts.id asc'));
     Venue::$hasOne = array();
     Employee::$hasOne = array(array('position'));
     Host::$hasMany = array(array('events', 'order' => 'id asc'));
     foreach ($this->relationshipNames as $name) {
         if (preg_match("/{$name}/i", $this->getName())) {
             $this->relationshipName = $name;
         }
     }
 }
開發者ID:ruri,項目名稱:php-activerecord-camelcased,代碼行數:14,代碼來源:RelationshipTest.php

示例13: set_up

 public function set_up($connection_name = null)
 {
     parent::set_up($connection_name);
     Event::$belongs_to = array(array('venue'), array('host'));
     Venue::$has_many = array(array('events', 'order' => 'id asc'), array('hosts', 'through' => 'events', 'order' => 'hosts.id asc'));
     Venue::$has_one = array();
     Employee::$has_one = array(array('position'));
     Host::$has_many = array(array('events', 'order' => 'id asc'));
     foreach ($this->relationship_names as $name) {
         if (preg_match("/{$name}/", $this->getName(), $match)) {
             $this->relationship_name = $match[0];
         }
     }
 }
開發者ID:Arunkumarcs,項目名稱:Themis-Reinitialize,代碼行數:14,代碼來源:RelationshipTest.php

示例14: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     $configuration = new DatabaseConfiguration();
     $configuration->setDriver(DriverType::SQLITE);
     $configuration->setDatabase('test.db');
     $configuration->register();
     // Create a db connection and tell Phactory to use it
     $pdo = new SQLiteConnection();
     self::$phactory = new Phactory($pdo);
     $pdo->exec("CREATE TABLE IF NOT EXISTS tests ( id INTEGER PRIMARY KEY, content TEXT )");
     // Reset any existing blueprints and empty any tables Phactory has used
     self::$phactory->reset();
     // Define default values for each test we will create
     self::$phactory->define('test', array('content' => 'Test Content $n'));
 }
開發者ID:waspframework,項目名稱:waspframework,代碼行數:15,代碼來源:DatabaseTest.php

示例15: setUp

 public function setUp($connectionName = null)
 {
     parent::setUp($connectionName);
     BookFormat::$validatesFormatOf[0] = array('name');
 }
開發者ID:ruri,項目名稱:php-activerecord-camelcased,代碼行數:5,代碼來源:ValidatesFormatOfTest.php


注:本文中的DatabaseTest類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。