Permalink
Browse files

Revert "Handle timestamp values correctly #28"

This reverts commit e15b210.
  • Loading branch information...
nateabele committed May 28, 2012
1 parent d0a11cb commit 6f135264f4d0529fe636bf939362afd81712a4a0
Showing with 0 additions and 17 deletions.
  1. +0 −8 data/source/Database.php
  2. +0 −9 tests/cases/data/source/DatabaseTest.php
View
@@ -196,14 +196,6 @@ public function value($value, array $schema = array()) {
return floatval($value);
case 'integer':
return intval($value);
- case 'timestamp':
- if ($value === 'CURRENT_TIMESTAMP') {
- return 'NULL';
- } else if (is_numeric($value)) {
- return date('Y-m-d H:i:s', $value);
- } else {
- return strtotime($value);
- }
}
}
@@ -98,15 +98,6 @@ public function testValueWithSchema() {
$result = $this->db->value('1', array('type' => 'string'));
$this->assertIdentical("'1'", $result);
-
- $result = $this->db->value('CURRENT_TIMESTAMP', array('type' => 'timestamp'));
- $this->assertIdentical('NULL', $result);
-
- $result = $this->db->value('1234567', array('type' => 'timestamp'));
- $this->assertIdentical(date('Y-m-d H:i:s', 1234567), $result);
-
- $result = $this->db->value('now', array('type' => 'timestamp'));
- $this->assertIdentical(time(), $result);
}
public function testValueByIntrospect() {

0 comments on commit 6f13526

Please sign in to comment.