diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-07-09 13:17:25 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@owncloud.com> | 2013-07-29 02:17:09 +0200 |
commit | b8bd1e5a81080a756913e5804b877aafd770f6e3 (patch) | |
tree | 407235c955fca7b3b837f9b779cb3bde8c95bdfc /tests/lib/db.php | |
parent | 05fa55f2eb6997f3b59a2418a64447427a1b19ec (diff) | |
download | nextcloud-server-b8bd1e5a81080a756913e5804b877aafd770f6e3.tar.gz nextcloud-server-b8bd1e5a81080a756913e5804b877aafd770f6e3.zip |
check type, assertgreaterthan
Diffstat (limited to 'tests/lib/db.php')
-rw-r--r-- | tests/lib/db.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/lib/db.php b/tests/lib/db.php index e965ce8e1cb..79e05f30a1c 100644 --- a/tests/lib/db.php +++ b/tests/lib/db.php @@ -74,14 +74,16 @@ class Test_DB extends PHPUnit_Framework_TestCase { public function testLastInsertId() { $query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`,`uri`) VALUES (?,?)'); - $result = OC_DB::executeAudited($query, array('insertid 1','uri_1')); + $result1 = OC_DB::executeAudited($query, array('insertid 1','uri_1')); $id1 = OC_DB::insertid('*PREFIX*'.$this->table2); + $this->assertInternalType('int', $id1); + // we don't know the id we should expect, so insert another row - $query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`,`uri`) VALUES (?,?)'); - $result = OC_DB::executeAudited($query, array('insertid 2','uri_2')); + $result2 = OC_DB::executeAudited($query, array('insertid 2','uri_2')); $id2 = OC_DB::insertid('*PREFIX*'.$this->table2); // now we can check if the two ids are in correct order - $this->assertEquals($id1+1, $id2); + $this->assertInternalType('int', $id2); + $this->assertGreaterThan($id1, $id2); } public function testinsertIfNotExist() { |