diff options
author | Andreas Fischer <bantu@owncloud.com> | 2013-12-12 13:14:43 +0100 |
---|---|---|
committer | Andreas Fischer <bantu@owncloud.com> | 2013-12-12 13:19:08 +0100 |
commit | f8d3b7cb6f5d08cac6ae160c749f923d62ef1378 (patch) | |
tree | 12e765ccb2de3438b778ac2e31cbe38fae28b44c /tests | |
parent | 7b20212c0a325e25a2dd8a70fc4ddb78a7d80855 (diff) | |
download | nextcloud-server-f8d3b7cb6f5d08cac6ae160c749f923d62ef1378.tar.gz nextcloud-server-f8d3b7cb6f5d08cac6ae160c749f923d62ef1378.zip |
DB tests: Test whether we can insert and read UTF8 data.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/db.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/lib/db.php b/tests/lib/db.php index 1977025cf12..96be3ea909e 100644 --- a/tests/lib/db.php +++ b/tests/lib/db.php @@ -145,4 +145,17 @@ class Test_DB extends PHPUnit_Framework_TestCase { $this->assertEquals(1, $result->numRows()); } + + 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']); + } } |