From 95f0cb2a2a8b93041eb7ee2acc25b801d96df232 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20Chilliet?= Date: Mon, 20 Jun 2022 17:34:29 +0200 Subject: [PATCH] Add a test about unserializing data from opis/closure serialization MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We need to be able to unserialize data from before upgrade. Signed-off-by: Côme Chilliet --- tests/lib/Command/CronBusTest.php | 7 +++++++ 1 file changed, 7 insertions(+) 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); + } } -- 2.39.5