assertSame($task, $job->getTask()); } /** * @expectedException \Error * @expectedExceptionMessage Classes implementing Amp\Parallel\Worker\Task must be autoloadable by the Composer autoloader */ public function testUnserialiableClass() { $task = new TestTask(42); $job = new Job($task); $serialized = \serialize($job); $job = \unserialize($serialized, ['allowed_classes' => [Job::class]]); $task = $job->getTask(); } }