1
0
mirror of synced 2025-01-23 16:51:41 +03:00

DDC-3065 - persister tests for criteria containing NULL values in IN() conditions

This commit is contained in:
Marco Pivetta 2014-04-03 17:17:24 +02:00
parent eb6498544f
commit a8b96803a4

View File

@ -13,9 +13,19 @@ require_once __DIR__ . '/../../TestInit.php';
class BasicEntityPersisterTypeValueSqlTest extends \Doctrine\Tests\OrmTestCase class BasicEntityPersisterTypeValueSqlTest extends \Doctrine\Tests\OrmTestCase
{ {
/**
* @var BasicEntityPersister
*/
protected $_persister; protected $_persister;
/**
* @var \Doctrine\ORM\EntityManager
*/
protected $_em; protected $_em;
/**
* {@inheritDoc}
*/
protected function setUp() protected function setUp()
{ {
parent::setUp(); parent::setUp();
@ -110,4 +120,25 @@ class BasicEntityPersisterTypeValueSqlTest extends \Doctrine\Tests\OrmTestCase
$statement = $this->_persister->getSelectConditionStatementSQL('test', null, array(), Comparison::NEQ); $statement = $this->_persister->getSelectConditionStatementSQL('test', null, array(), Comparison::NEQ);
$this->assertEquals('test IS NOT NULL', $statement); $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))
);
}
} }