From e15cf324c32a302c16d1cb68f91b79d232a98445 Mon Sep 17 00:00:00 2001 From: Matthieu Napoli Date: Tue, 6 Nov 2012 15:05:53 +0100 Subject: [PATCH 1/2] Fix and test for DDC-2073 --- lib/Doctrine/ORM/Persisters/BasicEntityPersister.php | 2 +- .../Persisters/BasicEntityPersisterTypeValueSqlTest.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php index 28cac813e..77a6e32b9 100644 --- a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php @@ -84,7 +84,7 @@ class BasicEntityPersister */ static private $comparisonMap = array( Comparison::EQ => '= %s', - Comparison::IS => '= %s', + Comparison::IS => 'IS %s', Comparison::NEQ => '!= %s', Comparison::GT => '> %s', Comparison::GTE => '>= %s', diff --git a/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php b/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php index fa1d7530a..f8ec2bb0d 100644 --- a/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php +++ b/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php @@ -88,4 +88,13 @@ class BasicEntityPersisterTypeValueSqlTest extends \Doctrine\Tests\OrmTestCase $this->assertEquals('t0."simple-entity-id" AS simpleentityid1, t0."simple-entity-value" AS simpleentityvalue2', $method->invoke($persister)); } + + /** + * @group DDC-2073 + */ + public function testSelectConditionStatementIsNull() + { + $statement = $this->_persister->getSelectConditionStatementSQL('test', null, array(), Comparison::IS); + $this->assertEquals('test IS ?', $statement); + } } From c2d9197900543f1c40bcc8eecc0e5b81af4acdfd Mon Sep 17 00:00:00 2001 From: Matthieu Napoli Date: Tue, 6 Nov 2012 15:12:19 +0100 Subject: [PATCH 2/2] Fix and test for DDC-2073 --- .../ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php b/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php index f8ec2bb0d..9f00090aa 100644 --- a/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php +++ b/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php @@ -7,6 +7,7 @@ use Doctrine\ORM\Persisters\BasicEntityPersister; use Doctrine\Tests\Models\CustomType\CustomTypeParent; use Doctrine\Tests\Models\CustomType\CustomTypeChild; use Doctrine\Tests\Models\CustomType\CustomTypeFriend; +use Doctrine\Common\Collections\Expr\Comparison; require_once __DIR__ . '/../../TestInit.php';