]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add a test about unserializing data from opis/closure serialization
authorCôme Chilliet <come.chilliet@nextcloud.com>
Mon, 20 Jun 2022 15:34:29 +0000 (17:34 +0200)
committerCôme Chilliet <come.chilliet@nextcloud.com>
Mon, 20 Jun 2022 15:34:29 +0000 (17:34 +0200)
We need to be able to unserialize data from before upgrade.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
tests/lib/Command/CronBusTest.php

index ea610a135d8daf55a6e93c4610f5e565a5c6122f..100de0a861c5fa7a1b1afe4b798d28e7f47a4341 100644 (file)
@@ -47,4 +47,11 @@ class CronBusTest extends AsyncBusTest {
                        $job->execute($this->jobList);
                }
        }
+
+       public function testClosureFromPreviousVersion() {
+               $serializedClosure = 'C:32:"Opis\\Closure\\SerializableClosure":217:{a:5:{s:3:"use";a:0:{}s:8:"function";s:64:"function () {\\Test\\Command\\AsyncBusTest::$lastCommand = \'opis\';}";s:5:"scope";s:24:"Test\\Command\\CronBusTest";s:4:"this";N;s:4:"self";s:32:"0000000027dcfe2f00000000407fa805";}}';
+               $this->jobList->add('OC\Command\ClosureJob', $serializedClosure);
+               $this->runJobs();
+               $this->assertEquals('opis', AsyncBusTest::$lastCommand);
+       }
 }