protected function setUp() { $this->classLoader = Zend_Loader_Autoloader::getInstance(); $this->classLoader->registerNamespace('Doctrine_'); if (!class_exists('Doctrine_Manager')) { $this->markTestSkipped('Doctrine 1.2.x installation not found in include_path'); } // create in memory connection Doctrine_Manager::connection("sqlite::memory:", 'doctrine'); }
protected function setUp() { $this->classLoader = Zend_Loader_Autoloader::getInstance(); $this->classLoader->registerNamespace('Doctrine_'); if (!class_exists('Doctrine_Manager')) { $this->markTestSkipped('Doctrine 1.2.x installation not found in include_path'); } // create in memory connection Doctrine_Manager::connection("sqlite::memory:", 'doctrine'); // create tables for account model Doctrine_Core::createTablesFromModels(dirname(__FILE__) . "/_files/models/"); }
/** * Constructor * * Initialize application. Potentially initializes include_paths, PHP * settings, and bootstrap class. * * @param string $environment * @param string|array|Zend_Config $options String path to configuration file, or array/Zend_Config of configuration options * @param bool $suppressNotFoundWarnings Should warnings be suppressed when a file is not found during autoloading? * @throws Zend_Application_Exception When invalid options are provided * @return void */ public function __construct($environment, $options = null, $suppressNotFoundWarnings = null) { $this->_environment = (string) $environment; require_once 'Zend/Loader/Autoloader.php'; $this->_autoloader = Zend_Loader_Autoloader::getInstance(); // instancja autoloader'a $this->_autoloader->suppressNotFoundWarnings($suppressNotFoundWarnings); // $this->_autoloader->registerNamespace('Common_'); // if (null !== $options) { if (is_string($options)) { $options = $this->_loadConfig($options); } elseif ($options instanceof Zend_Config) { $options = $options->toArray(); } elseif (!is_array($options)) { throw new Zend_Application_Exception('Invalid options provided; must be location of config file,' . ' a config object, or an array'); } $this->setOptions($options); } }