Commit 96eaf67e authored by romanb's avatar romanb

[2.0][DDC-350] Fixed. Patch provided by Christian Heinrich.

parent ac62e4d9
This diff is collapsed.
...@@ -56,18 +56,18 @@ class EntityManagerTest extends \Doctrine\Tests\OrmTestCase ...@@ -56,18 +56,18 @@ class EntityManagerTest extends \Doctrine\Tests\OrmTestCase
{ {
$this->assertType('\Doctrine\ORM\QueryBuilder', $this->_em->createQueryBuilder()); $this->assertType('\Doctrine\ORM\QueryBuilder', $this->_em->createQueryBuilder());
} }
public function testCreateQueryBuilderAliasValid() public function testCreateQueryBuilderAliasValid()
{ {
$q = $this->_em->createQueryBuilder() $q = $this->_em->createQueryBuilder()
->select('u')->from('Doctrine\Tests\Models\CMS\CmsUser', 'u'); ->select('u')->from('Doctrine\Tests\Models\CMS\CmsUser', 'u');
$q2 = clone $q; $q2 = clone $q;
$this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u', $q->getQuery()->getDql()); $this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u', $q->getQuery()->getDql());
$this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u', $q2->getQuery()->getDql()); $this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u', $q2->getQuery()->getDql());
$q3 = clone $q; $q3 = clone $q;
$this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u', $q3->getQuery()->getDql()); $this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u', $q3->getQuery()->getDql());
} }
...@@ -83,6 +83,26 @@ class EntityManagerTest extends \Doctrine\Tests\OrmTestCase ...@@ -83,6 +83,26 @@ class EntityManagerTest extends \Doctrine\Tests\OrmTestCase
$this->assertEquals('SELECT 1', $q->getDql()); $this->assertEquals('SELECT 1', $q->getDql());
} }
static public function dataMethodsAffectedByNoObjectArguments()
{
return array(
array('persist'),
array('remove'),
array('merge'),
array('refresh'),
array('detach')
);
}
/**
* @dataProvider dataMethodsAffectedByNoObjectArguments
* @expectedException \InvalidArgumentException
* @param string $methodName
*/
public function testThrowsExceptionOnNonObjectValues($methodName) {
$this->_em->$methodName(null);
}
static public function dataAffectedByErrorIfClosedException() static public function dataAffectedByErrorIfClosedException()
{ {
return array( return array(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment