Use old school query style that actually works.

remotes/origin/ldap_group_count
Andreas Fischer 11 years ago
parent f8d3b7cb6f
commit 95dd58bfc0
  1. 17
      tests/lib/db.php

@ -148,14 +148,13 @@ class Test_DB extends PHPUnit_Framework_TestCase {
public function testUtf8Data() { public function testUtf8Data() {
$table = "*PREFIX*{$this->table2}"; $table = "*PREFIX*{$this->table2}";
$conn = OC_DB::getConnection(); $expected = "Ћö雙喜\xE2\x80\xA2";
$data = array(
'uri' => 'uri_1', $query = OC_DB::prepare("INSERT INTO `$table` (`fullname`, `uri`, `carddata`) VALUES (?, ?, ?)");
'fullname' => "Ћö雙喜\xE2\x80\xA2", $result = $query->execute(array($expected, 'uri_1', 'This is a vCard'));
'carddata' => 'This is a vCard', $this->assertEquals(1, $result);
);
$conn->insert($table, $data); $actual = OC_DB::prepare("SELECT `fullname` FROM $table")->execute()->fetchOne();
$row = $conn->fetchAssoc("SELECT * FROM $table"); $this->assertSame($expected, $actual);
$this->assertSame($data['fullname'], $row['fullname']);
} }
} }

Loading…
Cancel
Save