public function setup()
 {
     parent::setup();
     RelationTestPerson::setupTables($this->db);
     RelationTestPerson::insertData($this->db);
     $this->session = new ezcPersistentSession($this->db, $this->defManager);
     $this->idMap = new ezcPersistentBasicIdentityMap($this->defManager);
     $this->options = new ezcPersistentSessionIdentityDecoratorOptions();
     $this->extractor = new ezcPersistentIdentityRelationObjectExtractor($this->idMap, $this->defManager, $this->options);
 }
예제 #2
0
 public function setup()
 {
     try {
         $this->db = ezcDbInstance::get();
     } catch (Exception $e) {
         $this->markTestSkipped('There was no database configured');
     }
     RelationTestPerson::setupTables();
     RelationTestPerson::insertData();
     $this->session = new ezcPersistentSession(ezcDbInstance::get(), new ezcPersistentCodeManager(dirname(__FILE__) . "/../data/"));
 }
예제 #3
0
파일: load_test.php 프로젝트: bmdevel/ezc
 public function testSubSelectDifferentClass()
 {
     RelationTestPerson::setupTables($this->session->database);
     RelationTestPerson::insertData($this->session->database);
     $q = $this->session->createFindQuery('RelationTestPerson');
     $subQ = $this->session->createSubQuery($q, 'RelationTestBirthday');
     $subQ->select('person');
     $q->where($q->expr->in('id', $subQ));
     $stmt = $q->prepare();
     $this->assertTrue($stmt->execute());
     $this->assertEquals(2, count($stmt->fetchAll()));
     RelationTestPerson::cleanup($this->session->database);
 }