コード例 #1
0
 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);
 }