Always transform the etag and read the data
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
2e9f105786
commit
bb754cb363
|
@ -994,6 +994,8 @@ class CardDavBackend implements BackendInterface, SyncSupport {
|
||||||
$queryResult->closeCursor();
|
$queryResult->closeCursor();
|
||||||
|
|
||||||
if (is_array($contact)) {
|
if (is_array($contact)) {
|
||||||
|
$contact['etag'] = '"' . $contact['etag'] . '"';
|
||||||
|
$contact['carddata'] = $this->readBlob($contact['carddata']);
|
||||||
$result = $contact;
|
$result = $contact;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -630,7 +630,7 @@ class CardDavBackendTest extends TestCase {
|
||||||
$this->invokePrivate($this->backend, 'getCardId', [1, 'uri']));
|
$this->invokePrivate($this->backend, 'getCardId', [1, 'uri']));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function testGetCardIdFailed() {
|
public function testGetCardIdFailed() {
|
||||||
$this->expectException(\InvalidArgumentException::class);
|
$this->expectException(\InvalidArgumentException::class);
|
||||||
|
|
||||||
|
@ -690,15 +690,15 @@ class CardDavBackendTest extends TestCase {
|
||||||
);
|
);
|
||||||
$query->execute();
|
$query->execute();
|
||||||
$query->insert($this->dbCardsPropertiesTable)
|
$query->insert($this->dbCardsPropertiesTable)
|
||||||
->values(
|
->values(
|
||||||
[
|
[
|
||||||
'addressbookid' => $query->createNamedParameter(0),
|
'addressbookid' => $query->createNamedParameter(0),
|
||||||
'cardid' => $query->createNamedParameter($vCardIds[0]),
|
'cardid' => $query->createNamedParameter($vCardIds[0]),
|
||||||
'name' => $query->createNamedParameter('CLOUD'),
|
'name' => $query->createNamedParameter('CLOUD'),
|
||||||
'value' => $query->createNamedParameter('John@nextcloud.com'),
|
'value' => $query->createNamedParameter('John@nextcloud.com'),
|
||||||
'preferred' => $query->createNamedParameter(0)
|
'preferred' => $query->createNamedParameter(0)
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$query->execute();
|
$query->execute();
|
||||||
$query->insert($this->dbCardsPropertiesTable)
|
$query->insert($this->dbCardsPropertiesTable)
|
||||||
->values(
|
->values(
|
||||||
|
@ -783,7 +783,7 @@ class CardDavBackendTest extends TestCase {
|
||||||
$this->assertSame('uri', $this->backend->getCardUri($id));
|
$this->assertSame('uri', $this->backend->getCardUri($id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function testGetCardUriFailed() {
|
public function testGetCardUriFailed() {
|
||||||
$this->expectException(\InvalidArgumentException::class);
|
$this->expectException(\InvalidArgumentException::class);
|
||||||
|
|
||||||
|
@ -812,7 +812,7 @@ class CardDavBackendTest extends TestCase {
|
||||||
$this->assertSame(0, (int)$result['addressbookid']);
|
$this->assertSame(0, (int)$result['addressbookid']);
|
||||||
$this->assertSame('uri0', $result['uri']);
|
$this->assertSame('uri0', $result['uri']);
|
||||||
$this->assertSame(5489543, (int)$result['lastmodified']);
|
$this->assertSame(5489543, (int)$result['lastmodified']);
|
||||||
$this->assertSame('etag0', $result['etag']);
|
$this->assertSame('"etag0"', $result['etag']);
|
||||||
$this->assertSame(120, (int)$result['size']);
|
$this->assertSame(120, (int)$result['size']);
|
||||||
|
|
||||||
// this shouldn't return any result because 'uri1' is in address book 1
|
// this shouldn't return any result because 'uri1' is in address book 1
|
||||||
|
|
Loading…
Reference in New Issue