コード例 #1
0
 /**
  * Primary key should differ
  */
 public function testSavedObjectCreatesDifferentHashForIdenticalObjects()
 {
     $book1 = new Book();
     $book1->setTitle('Foo5');
     $book1->setISBN('1234');
     $author1 = new Author();
     $author1->setFirstName('JAne');
     $author1->setLastName('JAne');
     $author1->addBook($book1);
     $author1->save();
     $author2 = new Author();
     $author2->setFirstName('JAne');
     $author2->setLastName('JAne');
     $author2->addBook($book1);
     $author2->save();
     $this->assertNotEquals($author1->hashCode(), $author2->hashCode());
 }