BDD

Uso del Page Object Pattern con Behat: esempio pratico

Il Page Object è un pattern utilizzato nei functional test per astrarre l’interazione con gli elementi della UI. All’interno di un oggetto vengono incapsulate le interazioni e le funzionalità di una pagina web che vengono esposte tramite api, nascondendo la struttura degli elementi HTML all’esterno. Per approfondire il concetto rimando…

Method order assertion in PHPSpec: Deferred Expectations

Disclaimer This post title can be misleading. Method order is just an implementation detail that should not be tested as PHPSpec philosophy is to test your public API, not the implementation as it would lead to fragile tests. Fundamentalists might say that following example should not be performed in PHPSpec but with…

The subtle difference of Prophecy doubles

Did you know that “under the hood” PHPSpec use Prophecy as library to create doubles? If you did not, now you do! If you read Prophecy documentation you may end up with some questions, so this guide is meant to be a quick tutorial to let you start working with the library:…