PestPHP `toHaveConstructor()` and `toHaveDestructor()` Expectations

PestPHP `toHaveConstructor()` and `toHaveDestructor()` Expectations

This past weekend, I decided to add a couple more Architecture Expectations to PestPHP. I spent some time last week writing Arch tests for an internal tool at work and found myself writing the following expectation quite a lot:

->toHaveMethod('__construct');

Now whilst this works, it didn't feel very fluent. I felt there was a much better way of doing this, so I thought about being able to instead do something like:

->toHaveConstructor();

or

->toHaveDestructor();

So that's what I did! This PR adds them in, clocking in at a whopping 94 lines of code 🤣

Under the hood, it's incredibly simple as it just calls the thing I was trying to avoid writing in the first place. You can consider these more like handy alias'.

Nuno Maduro merged this change into the core of PestPHP and it was released as v2.19!

If you end up using these in your tests, let me know!