示例#1
0
文件: basics.php 项目: AF83/morm
 public function testGetData()
 {
     $author = new Authors(array('name' => 'Chuck Norris'));
     $author->save();
     $post = new Mormons('authors');
     $this->assertEqual('Chuck Norris', $post->first()->name);
     $this->assertEqual(1, $post->first()->id);
 }
示例#2
0
文件: sti.php 项目: AF83/morm
 public function testInstanceSTI()
 {
     $this->user = $this->createEntry('OtherUser', array('name' => 'John Doe', 'othertype' => 'corrector'));
     $user = new Mormons('otheruser');
     $this->assertIsA($user->first(), 'Corrector');
 }