diff options
author | Louis <6653109+artonge@users.noreply.github.com> | 2023-04-04 10:23:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-04 10:23:54 +0200 |
commit | 7ab44b2d285ca2bfb9098746d2bb12968343b7c3 (patch) | |
tree | 0b0e2ac509251e8aef628ce796ffd1f21ef5b774 /tests/lib | |
parent | 135b0ded50a5909f78685f9bb09b84d42f8d51cd (diff) | |
parent | 1a6709cf434a6eeb7356254938b15c98d375a955 (diff) | |
download | nextcloud-server-7ab44b2d285ca2bfb9098746d2bb12968343b7c3.tar.gz nextcloud-server-7ab44b2d285ca2bfb9098746d2bb12968343b7c3.zip |
Merge pull request #37146 from nextcloud/artonge/feat/migrate_metadata_to_value
Migrate metadata JSON column to new value TEXT column
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/Metadata/FileMetadataMapperTest.php | 16 |
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); |