Skip to content

Commit

Permalink
Merge branch 'DDC-1612' into 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
beberlei committed Jan 21, 2012
2 parents 845d152 + d91e633 commit e10d865
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/UnitOfWork.php
Expand Up @@ -390,7 +390,7 @@ private function computeScheduleInsertsChangeSets()
*/
private function computeSingleEntityChangeSet($entity)
{
if ( ! $this->isInIdentityMap($entity) ) {
if ( $this->getEntityState($entity) !== self::STATE_MANAGED) {
throw new \InvalidArgumentException("Entity has to be managed for single computation " . self::objToStr($entity));
}

Expand Down
15 changes: 15 additions & 0 deletions tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php
Expand Up @@ -1141,6 +1141,21 @@ public function testFlushSingleAndNoCascade()
$this->_em->flush($user);
}

/**
* @group DDC-720
* @group DDC-1612
*/
public function testFlushSingleNewEntity()
{
$user = new CmsUser;
$user->name = 'Dominik';
$user->username = 'domnikl';
$user->status = 'developer';

$this->_em->persist($user);
$this->_em->flush($user);
}

/**
* @group DDC-720
*/
Expand Down

0 comments on commit e10d865

Please sign in to comment.