summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-12-01 01:29:35 -0800
committerThomas Müller <thomas.mueller@tmit.eu>2013-12-01 01:29:35 -0800
commit832be7c908b99bcc5ff93305e638086cc5784dd9 (patch)
treea7c710696ed0b3dbc83b1dfbb654b82672c57616 /tests/lib
parentc2b11cae83eb986f16253aa13f0b7cf494e1c680 (diff)
parent06df3822a0c52c44df4d5c8cc99576f5ac15864f (diff)
downloadnextcloud-server-832be7c908b99bcc5ff93305e638086cc5784dd9.tar.gz
nextcloud-server-832be7c908b99bcc5ff93305e638086cc5784dd9.zip
Merge pull request #6052 from owncloud/datetime-doctrine
Get rid of date strings for DB. Completely use Doctrine and DateTime.
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/db.php38
1 files changed, 0 insertions, 38 deletions
diff --git a/tests/lib/db.php b/tests/lib/db.php
index c87bee4ab99..1977025cf12 100644
--- a/tests/lib/db.php
+++ b/tests/lib/db.php
@@ -145,42 +145,4 @@ class Test_DB extends PHPUnit_Framework_TestCase {
$this->assertEquals(1, $result->numRows());
}
-
- /**
- * Tests whether the database is configured so it accepts and returns dates
- * in the expected format.
- */
- public function testTimestampDateFormat() {
- $table = '*PREFIX*'.$this->test_prefix.'timestamp';
- $column = 'timestamptest';
-
- $expectedFormat = 'Y-m-d H:i:s';
- $expected = new \DateTime;
-
- $query = OC_DB::prepare("INSERT INTO `$table` (`$column`) VALUES (?)");
- $result = $query->execute(array($expected->format($expectedFormat)));
- $this->assertEquals(
- 1,
- $result,
- "Database failed to accept dates in the format '$expectedFormat'."
- );
-
- $id = OC_DB::insertid($table);
- $query = OC_DB::prepare("SELECT * FROM `$table` WHERE `id` = ?");
- $result = $query->execute(array($id));
- $row = $result->fetchRow();
-
- $actual = \DateTime::createFromFormat($expectedFormat, $row[$column]);
- $this->assertInstanceOf(
- '\DateTime',
- $actual,
- "Database failed to return dates in the format '$expectedFormat'."
- );
-
- $this->assertEquals(
- $expected,
- $actual,
- 'Failed asserting that the returned date is the same as the inserted.'
- );
- }
}