Example #1
0
 public function testIfSessionCanAddEntity()
 {
     $project = new Project();
     $project->setName('My Project');
     $this->session->addEntity($project);
     $this->assertTrue($this->session->isAdded($project));
 }
Example #2
0
 public function init()
 {
     $autoloader = Zend_Loader_Autoloader::getInstance();
     $autoloader->registerNamespace('SimDAL_');
     SimDAL_Autoload::setDomainDirectory($this->domainPath);
     SimDAL_Autoload::loadNonDomainClasses(false);
     SimDAL_Session::factory(array('db' => $this->adapterConfig));
     $autoloader->pushAutoloader(array('SimDAL_Autoload', 'autoload'));
 }
Example #3
0
<?php

require_once 'init.php';
$mapper = SimDAL_Session::factory()->getMapper();
SimDAL_ProxyGenerator::generateProxies($mapper, DOMAIN_PATH . DIRECTORY_SEPARATOR . '.simdal');
Example #4
0
<?php

$domain_path = realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'TestDomain');
define('DOMAIN_PATH', $domain_path);
if (!isset($paths)) {
    $paths = array('curr_path' => get_include_path());
    $autoload = true;
}
if (!isset($dir)) {
    $paths['library'] = realpath(DOMAIN_PATH . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'library');
    $paths['domain'] = DOMAIN_PATH;
    $paths = array_reverse($paths, true);
    set_include_path(implode(PATH_SEPARATOR, $paths));
}
if ($autoload) {
    require_once 'SimDAL/Autoload.php';
    SimDAL_Autoload::setDomainDirectory(DOMAIN_PATH);
    spl_autoload_register(array('SimDAL_Autoload', 'autoload'));
}
SimDAL_Session::factory(include 'config.php');
Example #5
0
 protected function _startHookSession()
 {
     $this->_hookSession = SimDAL_Session::factory()->getNewSession();
 }