1
0
mirror of synced 2025-01-18 14:31:40 +03:00

Merge branch 'DDC-1612'

This commit is contained in:
Benjamin Eberlei 2012-01-21 13:06:38 +01:00
commit 44831f21c1
2 changed files with 16 additions and 1 deletions

View File

@ -390,7 +390,7 @@ class UnitOfWork implements PropertyChangedListener
*/ */
private function computeSingleEntityChangeSet($entity) 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)); throw new \InvalidArgumentException("Entity has to be managed for single computation " . self::objToStr($entity));
} }

View File

@ -1141,6 +1141,21 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this->_em->flush($user); $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 * @group DDC-720
*/ */