From ada16bfb5dc37eb00a54424c5d94340f9d256de0 Mon Sep 17 00:00:00 2001 From: pookey Date: Thu, 12 Jul 2007 20:12:38 +0000 Subject: [PATCH] Test case for incorrect population of nulls, refs #395 --- tests/Hydrate/FetchModeTestCase.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/Hydrate/FetchModeTestCase.php b/tests/Hydrate/FetchModeTestCase.php index 626e9238b..005681754 100644 --- a/tests/Hydrate/FetchModeTestCase.php +++ b/tests/Hydrate/FetchModeTestCase.php @@ -147,4 +147,17 @@ class Doctrine_Hydrate_FetchMode_TestCase extends Doctrine_UnitTestCase $this->assertEqual($this->conn->count(), $count + 1); } + + public function testFetchArrayNull() + { + $u = new User(); + $u->name = "fetch_array_test"; + $u->created = null; + $u->save(); + + $q = new Doctrine_Query(); + $q->select('u.*')->from('User u')->where('u.id = ?'); + $users = $q->execute(array($u->id), Doctrine_Hydrate::HYDRATE_ARRAY); + $this->assertEqual($users[0]['created'], null); + } }