Browse Source

Added failing test to prove #3410

Jose Lorenzo Rodriguez 12 years ago
parent
commit
4a0e322113
1 changed files with 12 additions and 0 deletions
  1. 12 0
      tests/TestCase/ORM/QueryRegressionTest.php

+ 12 - 0
tests/TestCase/ORM/QueryRegressionTest.php

@@ -107,4 +107,16 @@ class QueryRegressionTest extends TestCase {
 		$this->assertEquals(3, $results[3]->author->favorite_tag->id);
 	}
 
+/**
+ * Test for https://github.com/cakephp/cakephp/issues/3410
+ *
+ * @return void
+ */
+	public function testNullableTimeColumn() {
+		$table = TableRegistry::get('users');
+		$entity = $table->newEntity(['username' => 'derp', 'created' => null]);
+		$this->assertSame($entity, $table->save($entity));
+		$this->assertNull($entity->created);
+	}
+
 }