Codeception / module-symfony

Codeception module for testing apps using Symfony framework
MIT License
89 stars 24 forks source link

Document new Symfony assertions #202

Open ThomasLandauer opened 1 week ago

ThomasLandauer commented 1 week ago

The new assertions introduced in https://github.com/Codeception/module-symfony/releases/tag/3.5.0 should be added to the docs. Did you copy them one by one, or did you find a way to call them directly (i.e. future Symfony assertions will automatically work too)? Are these the ones we're talking about? https://symfony.com/doc/current/testing.html#testing-the-response-assertions

TavoNiievez commented 1 week ago

Hi @ThomasLandauer , the vast majority of the added assertions call directly to Constraints defined in Symfony. For example:

https://github.com/Codeception/module-symfony/blob/cad3c7a46da68f591dd363bc114ec9fde4f1dd63/src/Codeception/Module/Symfony/BrowserAssertionsTrait.php#L29-L31

while there are others that were translated to integrate with the module's service container. For example,

https://github.com/Codeception/module-symfony/blob/cad3c7a46da68f591dd363bc114ec9fde4f1dd63/src/Codeception/Module/Symfony/HttpClientAssertionsTrait.php#L17-L19

While, I added comment blocks for each assertion, the code examples are pending for someone to send a PR and add them.

I have updated the https://github.com/codeception/symfony-module-tests test project in all its branches to add tests to verify that these assertions work well. so the work around having that guidance available should be simple.