Testing with a browser using Mink
So far, we have been able to write acceptance tests for a script, but most of you are reading this book in order to write nice and shiny web applications. How can you take advantage of acceptance tests then? It is time to introduce the second PHP tool of this chapter: Mink.
Mink is actually an extension of Behat, which adds implementations of several steps related to web browser testing. For example, if you add Mink to your application, you will be able to add scenarios where Mink will launch a browser and click or type as requested, saving you a lot of time and effort in manual testing. However, first, let's take a look at how Mink can achieve this.
Types of web drivers
Mink makes use of web drivers—that is, libraries that have an API that allows you to interact with a browser. You can send commands, such as go to this page, click on this link, fill this input field with this text, and so on, and the web driver will translate this into the correct instruction...