3 namespace Doctrine\Tests\ORM\Functional\Ticket;
5 use Doctrine\Common\Collections\ArrayCollection;
6 require_once __DIR__ . '/../../../TestInit.php';
11 class DDC1129Test extends \Doctrine\Tests\OrmFunctionalTestCase
13 public function setUp()
15 $this->useModelSet('cms');
19 public function testVersionFieldIgnoredInChangesetComputation()
21 $article = new \Doctrine\Tests\Models\CMS\CmsArticle();
22 $article->text = "I don't know.";
23 $article->topic = "Who is John Galt?";
25 $this->_em->persist($article);
28 $this->assertEquals(1, $article->version);
30 $class = $this->_em->getClassMetadata('Doctrine\Tests\Models\CMS\CmsArticle');
31 $uow = $this->_em->getUnitOfWork();
33 $uow->computeChangeSet($class, $article);
34 $changeSet = $uow->getEntityChangeSet($article);
35 $this->assertEquals(0, count($changeSet), "No changesets should be computed.");
37 $article->text = "This is John Galt speaking.";
40 $this->assertEquals(2, $article->version);
42 $uow->computeChangeSet($class, $article);
43 $changeSet = $uow->getEntityChangeSet($article);
44 $this->assertEquals(0, count($changeSet), "No changesets should be computed.");