コード例 #1
0
ファイル: CoreTest.php プロジェクト: lciolecki/zf-doctrine
 public function setUp()
 {
     // singleton-mania! ;)
     Zend_Controller_Front::getInstance()->resetInstance();
     Doctrine_Manager::resetInstance();
     ZFDoctrine_Core::resetModelDirectories();
 }
コード例 #2
0
 public function setUp()
 {
     if (method_exists('Doctrine_Manager', 'resetInstance')) {
         // as of 1.2ALPHA3
         Doctrine_Manager::resetInstance();
     }
     $this->application = new Zend_Application('testing');
     $this->bootstrap = new Zend_Application_Bootstrap_Bootstrap($this->application);
     Zend_Controller_Front::getInstance()->resetInstance();
 }
コード例 #3
0
ファイル: DoctrineTest.php プロジェクト: robo47/parables
 public function tearDown()
 {
     if (method_exists('Doctrine_Manager', 'resetInstance')) {
         // as of 1.2ALPHA3
         Doctrine_Manager::resetInstance();
     }
     // Restore original autoloaders
     $loaders = spl_autoload_functions();
     foreach ($loaders as $loader) {
         spl_autoload_unregister($loader);
     }
     foreach ($this->loaders as $loader) {
         spl_autoload_register($loader);
     }
     // Reset autoloader instance so it doesn't affect other tests
     Zend_Loader_Autoloader::resetInstance();
 }
コード例 #4
0
 /**
  * Reset connection
  *
  * @param string  $profile_name (optional) Passed to init(), if given here.
  * @param string  $app_path     (optional) Passed to init(), if given here.
  * @return string|null
  */
 public static function reset($profile_name = null, $app_path = null)
 {
     foreach (self::$db_handles as $name => $conn) {
         $conn->close();
     }
     self::$master = null;
     self::$slave = null;
     self::$db_handles = array();
     self::$registry = null;
     self::$master_profile = null;
     self::$slave_profile = null;
     Doctrine_Manager::resetInstance();
     // not just reset()
     // If we were handed args, call init() on behalf of the user, and return the result.
     if (!empty($profile_name) || !empty($app_path)) {
         return self::init($profile_name, $app_path);
     }
 }