summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2023-03-30 15:58:42 +0200
committerLouis (Rebase PR Action) <artonge@users.noreply.github.com>2023-04-06 11:26:35 +0000
commit138702c60ca33e7f51caca6c3782c45ac4bda70d (patch)
tree99a0e50d8b8861870d8ed77febe01ed8043ce790 /tests/lib
parent76350d8a4dc3eea3c20ddea1a89ca4d8134ddd88 (diff)
downloadnextcloud-server-138702c60ca33e7f51caca6c3782c45ac4bda70d.tar.gz
nextcloud-server-138702c60ca33e7f51caca6c3782c45ac4bda70d.zip
Migrate metadata as JSON to value as STRING
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/Metadata/FileMetadataMapperTest.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/lib/Metadata/FileMetadataMapperTest.php b/tests/lib/Metadata/FileMetadataMapperTest.php
index 1a005f24b8a..4f7708ab9a9 100644
--- a/tests/lib/Metadata/FileMetadataMapperTest.php
+++ b/tests/lib/Metadata/FileMetadataMapperTest.php
@@ -51,23 +51,23 @@ class FileMetadataMapperTest extends \Test\TestCase {
$file1 = new FileMetadata();
$file1->setId(1);
$file1->setGroupName('size');
- $file1->setMetadata([]);
+ $file1->setArrayAsValue([]);
$file2 = new FileMetadata();
$file2->setId(2);
$file2->setGroupName('size');
- $file2->setMetadata(['width' => 293, 'height' => 23]);
+ $file2->setArrayAsValue(['width' => 293, 'height' => 23]);
// not added, it's the default
$file3 = new FileMetadata();
$file3->setId(3);
$file3->setGroupName('size');
- $file3->setMetadata([]);
+ $file3->setArrayAsValue([]);
$file4 = new FileMetadata();
$file4->setId(4);
$file4->setGroupName('size');
- $file4->setMetadata(['complex' => ["yes", "maybe" => 34.0]]);
+ $file4->setArrayAsValue(['complex' => ["yes", "maybe" => 34.0]]);
$this->mapper->insert($file1);
$this->mapper->insert($file2);
@@ -75,10 +75,10 @@ class FileMetadataMapperTest extends \Test\TestCase {
$files = $this->mapper->findForGroupForFiles([1, 2, 3, 4], 'size');
- $this->assertEquals($files[1]->getMetadata(), $file1->getMetadata());
- $this->assertEquals($files[2]->getMetadata(), $file2->getMetadata());
- $this->assertEquals($files[3]->getMetadata(), $file3->getMetadata());
- $this->assertEquals($files[4]->getMetadata(), $file4->getMetadata());
+ $this->assertEquals($files[1]->getValue(), $file1->getValue());
+ $this->assertEquals($files[2]->getValue(), $file2->getValue());
+ $this->assertEquals($files[3]->getDecodedValue(), $file3->getDecodedValue());
+ $this->assertEquals($files[4]->getValue(), $file4->getValue());
$this->mapper->clear(1);
$this->mapper->clear(2);