Example #1
0
 public function testTest()
 {
     $user1 = Model\User::find(1);
     $address1 = $user1->getAddress();
     $post1 = $user1->getPosts()->getFirst();
     $user2 = Model\User::find(1);
     $address2 = $user2->getAddress();
     $post2 = $user2->getPosts()->getFirst();
     $address3 = Model\Address::find(1);
     $post3 = Model\Post::find(1);
     $this->assertSame($user1, $user2);
     $this->assertSame($address1, $address2);
     $this->assertSame($post1, $post2);
     $this->assertSame($address1, $address3);
     $this->assertSame($post1, $post3);
 }
Example #2
0
 public function testInheritence()
 {
     $post1 = Model\Post::find(1);
     $post2 = Model\BlogPost::find(1);
     $this->assertSame($post1, $post2);
 }
Example #3
0
 /**
  * @covers ::getId
  * @covers ::setId
  */
 public function testGetSetId()
 {
     $post = Post::find(2);
     $this->assertEquals(2, $post->getId());
     $post->setId(4);
     $this->assertEquals(4, $post->getId());
 }