This extension IS NOT part of the Prooph project and is highly experimental.
You will need the Composer package manager to install this extension.
To install this package, run the following command:
$ composer require --dev gquemenr/prooph-phpspec-extension
Once, the package is install, create or edit your .phpspec.yml
configuration file
and register the extension:
extensions:
Prooph\PhpSpec\Extension: ~
This extension registers 2 matchers that'll help you describe the expected behaviors of your Prooph aggregate roots.
This matcher will check if your aggregate root has recorded at least one event of the provided class.
This matcher will check that the recorded events of your aggregate root matches conditions specified in the provided callback.
The callback has the following signature:
bool callback ( array $events )