DDC-3065 - persister tests for criteria containing NULL
values in IN()
conditions
This commit is contained in:
parent
eb6498544f
commit
a8b96803a4
@ -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))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user