@zapiz Xdebug is amazing, as others have suggested.
I also ensure full coverage with unit tests, using PHPUnit.
@zapiz Xdebug is amazing, as others have suggested.
I also ensure full coverage with unit tests, using PHPUnit.
Anyone who uses Paratest: do you have to do anything special to get it to run your test bootstrap per process? I have vlucas/phpdotenv loading env vars in my bootstrap, but when running with Paratest, none of the env vars are present.
I’ve tried using --bootstrap, and that doesn’t help.
I’m using $_ENV to access the env vars, in case that matters.
In collaboration with @localheinz I've build a small #github #actions utility workflow.
It describes how to segment a projects phpunit overall test-suite and distribute the load over parallel running github actions jobs
You can now sponsor @sebastian's work on #PHPUnit also using @Liberapay:
https://liberapay.com/sebastianbergmann
This might be more convenient for EU citizens than other platform.
A couple of years ago I wrote a #php script that mucks around with some system files. Because I didn't want to break my system while testing the code, I wrote some relatively tedious tests in #phpunit with mock objects, validating the parameters that were passed down to the filesystem.
It was a real pain in the butt, but I got the thing debugged without making a mess of my working environment.
Today I decided to add a new feature, and there's no way to express how much time having all that stuff set up saved. I copied a similar test, adapted it to the new feature, got it to pass tests, and deployed it without issue.
Coding a good test suite pays back over, and over, and over again.
Exciting News, PHPUnit and TYPO3 enthusiasts!
Are you ready to take your TYPO3 development skills to the next level? Join me at TYPO3Camp 2025 in Vienna for an in-depth PHPUnit workshop!
Date: Friday, 9 May 2025
Location: TYPO3Camp, Vienna
https://www.typo3camp.at/workshops/phpunit-in-typo3/
See you there! Let's code smarter, not harder.
Converting a PHPUnit TestListener to an Event Subscriber. #PHPunit
https://akrabat.com/converting-a-phpunit-testlistener-to-an-event-subscriber/
Here is a recording of my "So you think you know #PHPUnit?" presentation at #LaraconEU: https://youtu.be/CpkHHxE5g7c
We released 1.1.0 of event-sourcing-phpunit! See here for the changelog: https://github.com/patchlevel/event-sourcing-phpunit/releases/tag/1.1.0
#PHP #DDD #EventSourcing #PHPUnit #Testing
First project upgraded to #phpunit 12 without any code changes… Credit to @sebastian for such meticulous planning and detail with deprecations and what not! #php
Tomorrow I will share unique insights on how to get the most out of #PHPUnit in 2025:
https://phpunit.de/test-smarter-not-harder.html?ref=mastodon
Here is the material that I used for my "So you think you know #PHPUnit?" presentation at #LaraconEU:
https://thephp.cc/presentations/so-you-think-you-know-phpunit?ref=mastodon
This will be a crazy week: today and tomorrow I am at #LaraconEU and on Friday I will release #PHPUnit 12.
Why don't you join me on Friday for a two-hour, free-to-attend, online session?
https://phpunit.de/test-smarter-not-harder.html?ref=mastodon
I will talk about PHPUnit 12, of course, and share unique insights on how to get the most out of PHPUnit in 2025.
Looking for #phpunit code coverage dark-themes, are you using it?
Did not find any native support from PHPunit's tools, just some drop-in custom.css files.
Found so far just 2 of them:
1. https://github.com/chriswpage/phpunit-coverage-theme (updated 2024)
2. https://github.com/Porthorian/phpunit-code-coverage-theme (updated 2022)
From my preliminary research: the coverage tool is using bootstrap v4, while a dark-mode was only introduced in v5.3.
I should not dig into that migration path, or should I?
Join me for a two-hour, free-to-attend, online session on #PHPUnit 12 on February 7, 2025:
https://phpunit.de/test-smarter-not-harder.html?ref=mastodon
I just commited the first change to adapt #PHPUnit('s test suite) to #PHP 8.5:
https://github.com/sebastianbergmann/phpunit/commit/1881f84a3c61924851425ab0435ad9535aa7c7a2
SymfonyLive Berlin 2025: So you think you know PHPUnit. #symfony #PHPunit
https://symfony.com/blog/symfonylive-berlin-2025-so-you-think-you-know-phpunit?utm_source=Symfony%20Blog%20Feed&utm_medium=feed
Upgraded a #Symfony app from v5.4 to 6.4 in a couple of hours. Smooth process thanks to the recipes system and #Rector!
Well, some pitfalls are still around the corner, like (1) the split of the messenger-* component which dropped the doctrine transport, and (2) the new routing config via its recipe which by default uses #php Attributes.
The rest all smooth! Thank you all!
Sadly I discover that Rector did not rewrite #phpunit annotations to attributes, maybe because I use phpunit as phar?