lchrusciel / ApiTestCase

Handy PHPUnit test case for testing JSON APIs in your Symfony applications.
MIT License
410 stars 35 forks source link

Added Symfony 5 support #163

Closed angelov closed 4 years ago

angelov commented 4 years ago
Q A
Bug fix? no
New feature? yes?
BC breaks? no
Related tickets
License MIT

SymfonyHackday

lchrusciel commented 4 years ago

Hey Dejan!

Are you able to finish this PR? In case of any question, I'm on the hackathon as well ;)

angelov commented 4 years ago

Hey, I'm a bit blocked at this moment because "friendsofphp/php-cs-fixer" still doesn't support 5.0, but I'll see what else can be done in the next couple hours.

emodric commented 4 years ago

@angelov PHP CS Fixer now allows Symfony 5. Is there anything else that needs to be done here? Can I help?

lchrusciel commented 4 years ago

Hey @emodric, is it the only thing that blocks you from updating to Symfony 5? I will sit to this PR, but probably in mid December. Is it ok for you?

emodric commented 4 years ago

Not the only one, but one of the few, so no rush for now. Mid December is okay, that's the timeline we're planning to do a new releases that support Symfony 5.

emodric commented 4 years ago

@lchrusciel Hi Łukasz! Are there any news on merging this?

lchrusciel commented 4 years ago

it's blocking Sylius from Symfony bump as well. It should be fixed in the nearest days.

Sorry for delay

emodric commented 4 years ago

Thanks for the update :)

tavy315 commented 4 years ago

Are there any news on merging this?

lchrusciel commented 4 years ago

I know it took waaaaayy too long, but finally, it is there! I've just tagged 5.0@beta, so please let me know if you spot any issues with the current implementation.

Once again, I would like to thank @angelov & @loic425 for most of the work.

emodric commented 4 years ago

@lchrusciel Thanks for this!

However, I can't seem to install it on Symfony 5 still, becuase it depends on coduo/php-matcher 3.x, which does not support Symfony 5. Only 4.x version does.

lchrusciel commented 4 years ago

Yup, you are right. It was a good decision to publish a beta version ;) Will be fixed today

lchrusciel commented 4 years ago

Edi, can you try again? https://github.com/lchrusciel/ApiTestCase/releases/tag/v5.0.0-beta.2

emodric commented 4 years ago

@lchrusciel Install works fine, however, I get the following exception in my tests:

LogicException: Booting the kernel before calling
Symfony\Bundle\FrameworkBundle\Test\WebTestCase::createClient()
is not supported, the kernel should only be booted once.

Any tips on how to solve this? Does this come from this lib or is it my error?

lchrusciel commented 4 years ago

I don't have any clue. It worked smoothly on Sylius: https://github.com/Sylius/Sylius/pull/11281

emodric commented 4 years ago

Thanks, I'll dig deeper!

emodric commented 4 years ago

@lchrusciel FYI, the above error happened because I didn't call parent tearDown method in my overriden tearDown, which then in turn didn't shut down the kernel after the test ended, so Symfony complained on second test when static::createClient was called again.

lchrusciel commented 4 years ago

Therefore, I should tag a stable 5.0 this week ;)

emodric commented 4 years ago

I don't see a reason not to :)