summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@owncloud.com>2013-12-12 15:24:35 +0100
committerAndreas Fischer <bantu@owncloud.com>2013-12-12 15:24:35 +0100
commit95dd58bfc079fd9a46b1928ce22d5fb3faad44bd (patch)
treeddf1c8a443cad13135ccf30e7dc55d0aea191096 /tests
parentf8d3b7cb6f5d08cac6ae160c749f923d62ef1378 (diff)
downloadnextcloud-server-95dd58bfc079fd9a46b1928ce22d5fb3faad44bd.tar.gz
nextcloud-server-95dd58bfc079fd9a46b1928ce22d5fb3faad44bd.zip
Use old school query style that actually works.
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/db.php17
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/lib/db.php b/tests/lib/db.php
index 96be3ea909e..6b6d6b91088 100644
--- a/tests/lib/db.php
+++ b/tests/lib/db.php
@@ -148,14 +148,13 @@ class Test_DB extends PHPUnit_Framework_TestCase {
public function testUtf8Data() {
$table = "*PREFIX*{$this->table2}";
- $conn = OC_DB::getConnection();
- $data = array(
- 'uri' => 'uri_1',
- 'fullname' => "Ћö雙喜\xE2\x80\xA2",
- 'carddata' => 'This is a vCard',
- );
- $conn->insert($table, $data);
- $row = $conn->fetchAssoc("SELECT * FROM $table");
- $this->assertSame($data['fullname'], $row['fullname']);
+ $expected = "Ћö雙喜\xE2\x80\xA2";
+
+ $query = OC_DB::prepare("INSERT INTO `$table` (`fullname`, `uri`, `carddata`) VALUES (?, ?, ?)");
+ $result = $query->execute(array($expected, 'uri_1', 'This is a vCard'));
+ $this->assertEquals(1, $result);
+
+ $actual = OC_DB::prepare("SELECT `fullname` FROM $table")->execute()->fetchOne();
+ $this->assertSame($expected, $actual);
}
}