informatique:php:behaviour-driven_development_php
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| informatique:php:behaviour-driven_development_php [17/06/2026 09:36] – créée cyrille | informatique:php:behaviour-driven_development_php [17/06/2026 10:22] (Version actuelle) – [Behat] cyrille | ||
|---|---|---|---|
| Ligne 3: | Ligne 3: | ||
| Le Behaviour-Driven Development ([/ | Le Behaviour-Driven Development ([/ | ||
| - | **Behat**: Framework BDD le plus connu pour PHP, inspiré de [[https:// | + | Le BDD est bien adapté pour les [[/ |
| + | * https:// | ||
| + | |||
| + | **Behat**: Framework BDD le plus connu pour PHP, inspiré de [[https:// | ||
| **Codeception**: | **Codeception**: | ||
| - | Abandonné: | + | Abandonnés: |
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| + | |||
| + | ===== Behat ===== | ||
| + | |||
| + | How does Behat know what to do when it sees '' | ||
| + | |||
| + | You tell it: you write PHP code inside your context class (FeatureContext in our case) and tell Behat that this code represents a specific scenario step (via an attribute with a pattern): | ||
| + | |||
| + | <code php> | ||
| + | # | ||
| + | public function thereIsAWhichCostsPs($arg1, | ||
| + | { | ||
| + | throw new PendingException(); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | Those patterns could be quite powerful, but at the same time, writing them for all possible steps manually could become extremely tedious and boring. | ||
| + | |||
| + | **That’s why Behat does it** for you : | ||
| + | |||
| + | < | ||
| + | --- FeatureContext has missing steps. Define them with these snippets: | ||
| + | |||
| + | # | ||
| + | public function thereIsAWhichCostsPs($arg1, | ||
| + | { | ||
| + | throw new PendingException(); | ||
| + | } | ||
| + | </ | ||
| + | |||
informatique/php/behaviour-driven_development_php.1781681763.txt.gz · Dernière modification : de cyrille
