liip / LiipFunctionalTestBundle

Some helper classes for writing functional tests in Symfony
http://liip.ch
MIT License
641 stars 182 forks source link

Symfony 7 compatibillity #631

Closed kl3sk closed 6 months ago

kl3sk commented 6 months ago

This may allow Symfony 7 support.

Older version were dropped and older PHP version.

Fell free to comment/annotate 😃

Fixes #630

alexislefebvre commented 6 months ago

Do you know why it fails with PHP 8.2? It may be due to the fact that annotations are not working with PHP 8.2+. :grimacing:

It may work if we convert annotations to attributes in the test entity https://github.com/liip/LiipFunctionalTestBundle/blob/master/tests/App/Entity/User.php

kl3sk commented 6 months ago

This what I was searching for, and agree that is a Doctrine Annotation vs Attributes conflict.

If I'm not wrong, both can be used at the same time.

I'll have a try

alexislefebvre commented 6 months ago

Please hold on, let's check something first: https://github.com/liip/LiipFunctionalTestBundle/issues/630#issuecomment-1878887565

kl3sk commented 6 months ago

Ok, so what's next.

Do we close it or I can push my tries with attributes to see what happens ?

alexislefebvre commented 6 months ago

As you want, you can try to migrate to a YAML configuration as in LiipFunctionalTestBundle: https://github.com/liip/LiipTestFixturesBundle/blob/19c9f4281bff0d5e3571de4ba71b66c85ba0b0c4/tests/App/DataFixtures/ORM/user.yml https://github.com/liip/LiipTestFixturesBundle/blob/19c9f4281bff0d5e3571de4ba71b66c85ba0b0c4/tests/App/Resources/config/doctrine/User.orm.yml

Otherwise we'll be able to do it, no problem.

kl3sk commented 6 months ago

LiipFunctionalTestBundle Works fine, this bundle may be at least upgradable to 7.0

The other problème is here I think.

https://github.com/liip/LiipFunctionalTestBundle/blob/5658b8a2781e12c2d195a83111e171d659f1fdf9/tests/App/config.yml#L39

But how say use attribute for 8.2 and annotation otherwise

I change to attribute to test it.

alexislefebvre commented 6 months ago

But how say use attribute for 8.2 and annotation otherwise

Are annotations still necessary? I'm pretty sure that attributes can be used with Symfony 5.4+.

alexislefebvre commented 6 months ago

If you want to continue to work on this subject, please open another PR where you only drop support of Symfony 4.4 (you'll have to create a branch for that). Once it will be merged, you'll be able to rebase this PR and tests will be run automatically.

alexislefebvre commented 6 months ago

But how say use attribute for 8.2 and annotation otherwise

Are annotations still necessary? I'm pretty sure that attributes can be used with Symfony 5.4+.

My bad, it requires PHP 8.0+. :grimacing:

alexislefebvre commented 6 months ago

I opened a new PR based on this one:

alexislefebvre commented 6 months ago

See the release: https://github.com/liip/LiipFunctionalTestBundle/issues/630#issuecomment-1880127819