Today we are excited to announce the release of Pest v0.3! In the past months, we spent a lot of time working on the new Expectation API, and a brand new PHPStorm plugin, and more. Additionally, we've prepared Pest internally for PHP 8.
Now, let's see in more detail the changes we've merged into this release:
When we first released Pest, we already had in mind where we wanted Pest to be: simple, minimal, and elegant in all parts of testing.
The expectation API in this new version v0.3 is, in our opinion, a simpler alternative to the existing assertions API. Let's see some examples:
In this first example, you can immediately see how simple is the expectations API: chained expectations, less code, and it feels like a natural sentence.
In this example 2, you can see that the expectation API makes use of the not modifier for creating inverse expectations.
Next, in this example 3, you can see that you can also chain assertions on different values, and also how the naming as being improved: assertStringContainsString vs toContain.
Finally, in the example 4, are some examples of the methods you can use while creating expectations. Head over to our website to find more about the expectation API: pestphp.com/docs/expectations.