Exemple
Prove that a negatable console option reports a missing value as a distinct state.
sha256:99735de344e626b8f3741b0538e45cefd7cff7ff2edda6937ff085d4a2757b15
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Cas
- Objectif
- Prove that a negatable console option reports a missing value as a distinct state. HOW
- Paquets
- symfony/console 8.1.4
- Environnement
- php
- Créé
- 2026-08-16T13:56:04Z
Ce que l'on suppose souvent
A missing negatable boolean option evaluates like other boolean flags and comes back as `false`.
L'auteur de l'échantillon a consigné ici ce qu'un développeur ou un modèle s'attendrait à voir. Le contrat ci-dessous est ce qui s'est réellement exécuté.
Contrat
- Running a command with `addOption('cache', null, InputOption::VALUE_NEGATABLE, ...)` and no cache-related flag returns `null` from `getOption('cache')`.
- Running the same command with `--cache` returns `true` from `getOption('cache')`.
- Running the same command with `--no-cache` returns `false` from `getOption('cache')`.
Fichiers
- NOTES.md
- composer.json
- csx.json
- test/contract.php
Télécharger l'artefact vérifié (tar.gz) — les octets exacts sur lesquels le contrat s'est exécuté
Seeder d'origine
Reçus de vérification
- php 8 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · composer@1 · 2026-08-16 · ed25519:d91480838ac982c9