protected function setUp() { _SF_Autloader_SetUp(); // configure the resource loader atuo load models $loader = new Zend_Loader_Autoloader_Resource(array('basePath' => APPLICATION_PATH . '/modules/storefront', 'namespace' => 'Storefront')); $loader->addResourceType('Model', 'models', 'Model'); // configure another loader so we can replace Model Resources $loader = new Zend_Loader_Autoloader_Resource(array('basePath' => dirname(__FILE__), 'namespace' => 'Storefront')); $loader->addResourceType('modelResource', 'TestResources', 'Resource'); $this->_model = new Storefront_Model_Catalog(); }
protected function setUp() { _SF_Autloader_SetUp(); Zend_Loader::loadClass('Zend_Session_Namespace'); // configure the resource loader atuo load models $loader = new Zend_Loader_Autoloader_Resource(array('basePath' => APPLICATION_PATH . '/modules/storefront', 'namespace' => 'Storefront')); $loader->addResourceType('Model', 'models', 'Model'); $loader->addResourceType('ModelResource', 'models/resources', 'Resource'); $loader->addResourceType('Form', 'forms', 'Form'); $loader->addResourceType('Service', 'services', 'Service'); $mockNS = $this->getMock('Zend_Session_Namespace'); $this->_model = new Storefront_Model_Cart(array('sessionNs' => $mockNS)); }
set_include_path(implode(PATH_SEPARATOR, $paths)); defined('APPLICATION_PATH') or define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application')); /** * Autoloader helpers */ function _SF_Autloader_SetUp() { require_once 'Zend/Loader/Autoloader.php'; $loader = Zend_Loader_Autoloader::getInstance(); $loader->registerNamespace('SF_'); } function _SF_Autloader_TearDown() { Zend_Loader_Autoloader::resetInstance(); $loader = Zend_Loader_Autoloader::getInstance(); $loader->registerNamespace('SF_'); } /** * Init autoloader */ _SF_Autloader_SetUp(); /** * Start session now! */ Zend_Session::$_unitTestEnabled = true; Zend_Session::start(); /** * Ignore folders from code coverage etc */ PHPUnit_Util_Filter::addDirectoryToFilter("{$root}/tests"); PHPUnit_Util_Filter::addDirectoryToFilter("{$root}/library/Zend");