summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-06-20 17:34:29 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2022-06-20 17:34:29 +0200
commit95f0cb2a2a8b93041eb7ee2acc25b801d96df232 (patch)
treec793e0c8c5b39b5d5b9d2f1f3444aed748db5164 /tests
parenta810b213733585a12d22f3e94bfb4e1fa3cb3f5b (diff)
downloadnextcloud-server-95f0cb2a2a8b93041eb7ee2acc25b801d96df232.tar.gz
nextcloud-server-95f0cb2a2a8b93041eb7ee2acc25b801d96df232.zip
Add a test about unserializing data from opis/closure serialization
We need to be able to unserialize data from before upgrade. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Command/CronBusTest.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/lib/Command/CronBusTest.php b/tests/lib/Command/CronBusTest.php
index ea610a135d8..100de0a861c 100644
--- a/tests/lib/Command/CronBusTest.php
+++ b/tests/lib/Command/CronBusTest.php
@@ -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);
+ }
}