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


PHP CakeTestFixture::drop方法代码示例

本文整理汇总了PHP中CakeTestFixture::drop方法的典型用法代码示例。如果您正苦于以下问题:PHP CakeTestFixture::drop方法的具体用法?PHP CakeTestFixture::drop怎么用?PHP CakeTestFixture::drop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CakeTestFixture的用法示例。


在下文中一共展示了CakeTestFixture::drop方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _setupTable

 /**
  * Runs the drop and create commands on the fixtures if necessary.
  *
  * @param CakeTestFixture $fixture the fixture object to create
  * @param DataSource $db the datasource instance to use
  * @param boolean $drop whether drop the fixture if it is already created or not
  * @return void
  */
 protected function _setupTable($fixture, $db = null, $drop = true)
 {
     if (!$db) {
         if (!empty($fixture->useDbConfig)) {
             $db = ClassRegistry::getDataSource($fixture->useDbConfig);
         } else {
             $db = $this->_db;
         }
     }
     if (!empty($fixture->created) && in_array($db->configKeyName, $fixture->created)) {
         return;
     }
     $sources = $db->listSources();
     $table = $db->config['prefix'] . $fixture->table;
     if ($drop && in_array($table, $sources)) {
         $fixture->drop($db);
         $fixture->create($db);
     } elseif (!in_array($table, $sources)) {
         $fixture->create($db);
     }
 }
开发者ID:pkdevbox,项目名称:app.director,代码行数:29,代码来源:CakeFixtureManager.php

示例2: getFixtures

 /**
  * @brief get the fixtures
  *
  * This method will first get any required fixtures from events for plugins
  * that need to load up fixtures regardless. Any fixtures you have specifically
  * loaded will then be setup. After that any fixtures for the model that is being
  * tested will be loaded and all dependencies that are found. Finally any
  * replacements that you need doing are done.
  *
  * replacements:
  *	you can replace the default fixture that is loaded automatically with
  *	your own. too do this you just pass the array with (oldfixture => newfixture).
  *	this is used when you need to load up your own data instead of some core
  *	data for example.
  *
  * @access public
  *
  * @param string $model the model that is being loaded
  * @param bool $load true will insert data, false will only load up fixtures
  *
  * @return void
  */
 public function getFixtures($model = null, $load = false)
 {
     $this->fixturesFromEvents();
     $this->getRequestsedFixtures();
     if ($model) {
         $this->fixturesForModel($model);
     }
     $this->getRequestsedFixtures('replace');
     $CakeTestFixture = new CakeTestFixture();
     $CakeTestFixture->drop($this->__testObject->db);
     $this->loadFixtures($this->__fixturesToLoad, $load);
 }
开发者ID:nani8124,项目名称:infinitas,代码行数:34,代码来源:AppTest.php

示例3: _setupTable

 /**
  * Runs the drop and create commands on the fixtures if necessary
  *
  * @param CakeTestFixture $fixture the fixture object to create
  * @param DataSource $db the datasource instance to use
  * @param boolean $drop whether drop the fixture if it is already created or not
  * @return void
  */
 protected function _setupTable($fixture, $db = null, $drop = true)
 {
     if (!$db) {
         $db = $this->_db;
     }
     if (!empty($fixture->created) && $fixture->created == $db->configKeyName) {
         return;
     }
     $cacheSources = $db->cacheSources;
     $db->cacheSources = false;
     $sources = $db->listSources();
     $db->cacheSources = $cacheSources;
     $table = $db->config['prefix'] . $fixture->table;
     if ($drop && in_array($table, $sources)) {
         $fixture->drop($db);
         $fixture->create($db);
         $fixture->created = $db->configKeyName;
     } elseif (!in_array($table, $sources)) {
         $fixture->create($db);
         $fixture->created = $db->configKeyName;
     }
 }
开发者ID:Nervie,项目名称:Beta,代码行数:30,代码来源:CakeFixtureManager.php

示例4: _setupTable

 /**
  * Runs the drop and create commands on the fixtures if necessary.
  *
  * @param CakeTestFixture $fixture the fixture object to create
  * @param DataSource $db the datasource instance to use
  * @param bool $drop whether drop the fixture if it is already created or not
  * @return void
  */
 protected function _setupTable($fixture, $db = null, $drop = true)
 {
     if (!$db) {
         if (!empty($fixture->useDbConfig)) {
             $db = ConnectionManager::getDataSource($fixture->useDbConfig);
         } else {
             $db = $this->_db;
         }
     }
     if (!empty($fixture->created) && in_array($db->configKeyName, $fixture->created)) {
         return;
     }
     $sources = (array) $db->listSources();
     $table = $db->config['prefix'] . $fixture->table;
     $exists = in_array($table, $sources);
     if ($drop && $exists) {
         $fixture->drop($db);
         $fixture->create($db);
     } elseif (!$exists) {
         $fixture->create($db);
     } else {
         $fixture->created[] = $db->configKeyName;
     }
 }
开发者ID:agashish,项目名称:test_new,代码行数:32,代码来源:CakeFixtureManager.php

示例5: drop

 /**
  * Drops the table from the test datasource
  *
  * @param DboSource $db
  * @return void
  */
 public function drop($db)
 {
     unset(static::$_tableHashes[$this->table]);
     return parent::drop($db);
 }
开发者ID:theplankmeister,项目名称:cakephp-fixturize,代码行数:11,代码来源:TableCopyTestFixture.php


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