Make unit tests working

This commit is contained in:
Eric Espie
2025-10-02 09:48:22 +02:00
parent 0ea0da525e
commit 39fd879ca9
83 changed files with 1924 additions and 262 deletions

View File

@@ -65,7 +65,7 @@ class FormDataCollector extends DataCollector implements FormDataCollectorInterf
public function __construct(FormDataExtractorInterface $dataExtractor)
{
if (!class_exists(ClassStub::class)) {
throw new \LogicException(sprintf('The VarDumper component is needed for using the "%s" class. Install symfony/var-dumper version 3.4 or above.', __CLASS__));
throw new \LogicException(\sprintf('The VarDumper component is needed for using the "%s" class. Install symfony/var-dumper version 3.4 or above.', __CLASS__));
}
$this->dataExtractor = $dataExtractor;
@@ -200,10 +200,7 @@ class FormDataCollector extends DataCollector implements FormDataCollectorInterf
return $this->data;
}
/**
* @internal
*/
public function __sleep(): array
public function __serialize(): array
{
foreach ($this->data['forms_by_hash'] as &$form) {
if (isset($form['type_class']) && !$form['type_class'] instanceof ClassStub) {
@@ -211,9 +208,7 @@ class FormDataCollector extends DataCollector implements FormDataCollectorInterf
}
}
$this->data = $this->cloneVar($this->data);
return parent::__sleep();
return ['data' => $this->data = $this->cloneVar($this->data)];
}
protected function getCasters(): array