Ceci est une ancienne révision du document !
Table des matières
Behaviour-Driven Development pour Php
Le Behaviour-Driven Development ([/glossaire/BDD|BDD]]) est idéal pour les tests d'acceptation et la collaboration entre équipes techniques et métiers.
Behat: Framework BDD le plus connu pour PHP, inspiré de Cucumber. Permet de décrire le comportement de l'application en langage naturel (Gherkin). Intégration facile avec Symfony et Laravel. https://docs.behat.org, https://github.com/Behat/Behat
Codeception: Framework de test PHP qui supporte le style BDD. provides high-level domain language for tests. Tests are represented as a set of user's actions. Symfony, Laravel, Zend Framework, Yii, Phalcon are supported. https://codeception.com
Abandonnés:
Behat
How does Behat know what to do when it sees Given there is a “Sith Lord Lightsaber”, which costs £5?
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):
#[Given('there is a(n) :arg1, which costs £:arg2')] public function thereIsAWhichCostsPs($arg1, $arg2) { throw new PendingException(); }
