Beispiel #1
0
 public function testQueryManySubclasses()
 {
     $b = new Bug();
     $b->setID(1);
     $b->setName("bug");
     $fb = new FunctionalBug();
     $fb->setID(2);
     $fb->setName("functional bug");
     $fb->setSteps("some steps");
     $tb = new TechnicalBug();
     $tb->setID(3);
     $tb->setName("technical bug");
     $tb->setErrorCode(124);
     $this->session->save($b);
     $this->session->save($fb);
     $this->session->save($tb);
     $this->session->flush();
     $this->session->clear();
     $bugs = $this->session->from("Bug")->find();
     $this->assertThat($bugs[0], $this->isInstanceOf("Bug_OutletProxy"));
     $this->assertThat($bugs[1], $this->isInstanceOf("FunctionalBug_OutletProxy"));
     $this->assertThat($bugs[2], $this->isInstanceOf("TechnicalBug_OutletProxy"));
 }
Beispiel #2
0
 protected function selectRecords($times)
 {
     // TODO: should we clear identity map after querying?
     for ($i = 0; $i < $times; $i++) {
         $this->outletSession->from('User')->find();
     }
 }