$fields * @return array> */ private function serialize(array $fields): array { $ref = new ReflectionClass(BlueprintController::class); $instance = $ref->newInstanceWithoutConstructor(); return $ref->getMethod('serializeFields')->invoke($instance, $fields); } #[Test] public function boolean_option_labels_become_yes_no(): void { // What native YAML 1.1 produces from `'0': No` / `'1': Yes`. $fields = $this->serialize([ 'chromeless.enabled' => [ 'type' => 'toggle', 'options' => ['0' => false, '1' => true], 'validate' => ['type' => 'bool'], ], ]); $options = $fields[0]['options']; $this->assertSame([ ['value' => '0', 'label' => 'No'], ['value' => '1', 'label' => 'Yes'], ], $options); } }