[Pkg-owncloud-commits] [owncloud] 04/52: Timestamp test is no longer necessary as we rely on Doctrine and DateTime.

David Prévot taffit at moszumanska.debian.org
Mon Dec 2 01:49:36 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 06df3822a0c52c44df4d5c8cc99576f5ac15864f
Author: Andreas Fischer <bantu at owncloud.com>
Date:   Tue Nov 26 12:22:08 2013 +0100

    Timestamp test is no longer necessary as we rely on Doctrine and DateTime.
---
 tests/lib/db.php | 38 --------------------------------------
 1 file changed, 38 deletions(-)

diff --git a/tests/lib/db.php b/tests/lib/db.php
index c87bee4..1977025 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.'
-		);
-	}
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list