diff --git a/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php b/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php index 668ff13a0..686f2ee18 100644 --- a/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php +++ b/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php @@ -13,9 +13,19 @@ require_once __DIR__ . '/../../TestInit.php'; class BasicEntityPersisterTypeValueSqlTest extends \Doctrine\Tests\OrmTestCase { + /** + * @var BasicEntityPersister + */ protected $_persister; + + /** + * @var \Doctrine\ORM\EntityManager + */ protected $_em; + /** + * {@inheritDoc} + */ protected function setUp() { parent::setUp(); @@ -110,4 +120,25 @@ class BasicEntityPersisterTypeValueSqlTest extends \Doctrine\Tests\OrmTestCase $statement = $this->_persister->getSelectConditionStatementSQL('test', null, array(), Comparison::NEQ); $this->assertEquals('test IS NOT NULL', $statement); } + + /** + * @group DDC-3056 + */ + public function testSelectConditionStatementWithMultipleValuesContainingNull() + { + $this->assertEquals( + '(t0.id IN (?) OR t0.id IS NULL)', + $this->_persister->getSelectConditionStatementSQL('id', array(null)) + ); + + $this->assertEquals( + '(t0.id IN (?) OR t0.id IS NULL)', + $this->_persister->getSelectConditionStatementSQL('id', array(null, 123)) + ); + + $this->assertEquals( + '(t0.id IN (?) OR t0.id IS NULL)', + $this->_persister->getSelectConditionStatementSQL('id', array(123, null)) + ); + } }