Beispiel #1
0
 public function testAutoUpdate()
 {
     $this->connection->execute('INSERT INTO bugs (id, name) VALUES (1, "test")');
     $bug = $this->session->load('Bug', 1);
     $bug->setName('new name');
     $this->session->flush();
     $this->session->clear();
     $this->assertEquals('new name', $this->session->load('Bug', 1)->getName());
 }
Beispiel #2
0
 public function testLoadSubclassFromSuperclass()
 {
     $bug = new FunctionalBug();
     $bug->setID(1);
     $bug->setName("Error while saving subclass :P");
     $bug->setSteps("Executed unit tests... this doesn't make any sense! lol");
     $this->session->save($bug);
     $this->session->flush();
     $this->session->clear();
     $newbug = $this->session->load("Bug", 1);
     $this->assertNotNull($newbug);
     $this->assertThat($newbug, $this->isInstanceOf("FunctionalBug"));
 }