ramsey, to random
@ramsey@phpc.social avatar

Is there a way to disable or hide the deprecations? I have 265 of them for data providers that aren’t static, and I can’t easily switch to static data providers, since many of the data providers call instance methods (i.e., $this). So, it’s going to take me a long time to upgrade my tests so that I can upgrade to PHPUnit 10.

ramsey, to php
@ramsey@phpc.social avatar

I’m trying to run “Debug” (for step-debugging with ) in while running a test. I do this all the time with standard tests, and I’ve never had this problem…

The test runner stops immediately, and PhpStorm reports in the debug console, “Test framework quit unexpectedly.”

Has anyone else seen this error? Do you know what causes it?

Crell, to php
@Crell@phpc.social avatar

I have only recently learned of the "before" attribute in @phpunit. It seems appealing. What I don't get is... why would I ever use setUp() when I can instead use a before method? It seems like the easier, more portable solution in ever case except when I actively want to bypass a parent class's setUp().

(Same for beforeClass.)

brunty, to php
@brunty@brunty.social avatar

folks, what framework-agnostic tooling (as in not / / etc) are you using for running headless browser-based tests these days via something like ?

I'm looking at setting something up in on , I've tried Symfony Panther and it's been a shitshow of errors and not being able to get or running in Docker :/

sebastian, to random
@sebastian@phpc.social avatar

If you install #PHPUnit using Composer (which is not the recommended way) then you can now use both PHPUnit 9.6 and PHPUnit 10.5 in projects that depend on either PHP-Parser 4 or PHP-Parser 5.

https://github.com/sebastianbergmann/php-code-coverage/issues/1004

sebastian, to php
@sebastian@phpc.social avatar

Looking at the website, I do not see a Call for Papers. Is it already over? Will there be none? Am I blind? I would like to share what we have been up to in land with the community 😉

markusstaab, to opensource German
@markusstaab@phpc.social avatar

anyone aware of a #opensource #project which is heavily relying on #phpunit process isolation?

I am working on reducing overhead of process isolation and would love testing my progress on a real world test-suite.

RT welcome

andrewfeeney, to random
@andrewfeeney@phpc.social avatar

Trying to find a straightforward way to merge XML coverage reports generated by #phpunit via #CodeCeption. The end goal is a nice HTML report. I can generate the HTML report or XML for a single chunk, but none of the tooling I can find to combine the chunks works. There's an open bug in #phpcov which prevents the serialized PHP reports from being able to be combined.

I'd consider tools in php, python, node, rust, or binaries for mac or linux.

Does anyone have a go to solution?

Crell, to php
@Crell@phpc.social avatar

#PHPUnit 9 says to stop using assertObjectHasAttribute() in favor of assertObjectHasProperty(). But the latter doesn't exist in PHPUnit 9, only in PHPUnit 10.

Am I missing something obvious? Because that's not how deprecation warnings are supposed to work... #PHP

sebastian, to random
@sebastian@phpc.social avatar

The last #PHPUnit code sprint was four (!) years ago:

https://phpunit.de/code-sprints/september-2019.html

Teaser: The next one will be in March in Hamburg. Details: soon.

sebastian, to php
@sebastian@phpc.social avatar

It's that time again: I'm thinking about what I want to share at conferences about in general and with in particular.

Feel free to write your ideas and wishes in a reply to this toot.

sebastian, to random
@sebastian@phpc.social avatar

2024 will be the 25ᵗʰ year in which I work on #PHPUnit:

https://sebastian-bergmann.de/open-source.html

beberlei, to random German
@beberlei@phpc.social avatar

When to use a data provider vs multiple tests in #PHPUnit? Imho there are two requirements that would let me to pick data providers to test variants:

  1. The input of the data provider is not used for if conditions that lead to different code being executed in the test.
  2. The data provider input and output variables should fit on a single line, or if an array/object is part of the test dataset, a handful of lines at max.*
jaapio, to php Dutch
@jaapio@phpc.social avatar

discovered livetechhelper.com, while the initiative could be positive explained, the execution is horrible! I found https://livetechhelper.com/repos/jaapio/phpunit
I can help with #phpunit but obviously any income should go to the original maintainers not to me because I created a fork!

Same applies to other projects, should we stop this?! #php #foss?

sebastian, (edited ) to random
@sebastian@phpc.social avatar

This Friday, February 16, 2024, from 10:00 to 12:00 (Europe/Berlin), I will explain the motivation behind the most important changes in #PHPUnit 11 and demonstrate them with live coding. We will cover new features as well as migrating from PHPUnit 10 to PHPUnit 11.

This online event is part of thePHP.cc's education flatrate, but is free and open to all.

Would you like to attend? Just send me an e-mail with the subject "PHPUnit 11 Live Demonstration" to sebastian@thephp.cc.

See you on Friday?

ramsey, to random
@ramsey@phpc.social avatar

#PhpStorm needs to add little “play” buttons next to each of the #PHPUnit TestWith attributes.

Along these same lines, when I have a base test case that uses a data provider defined in child test classes, PhpStorm should be able to figure out that the method in the child is a data provider and add “play” buttons there, as well.

lolli, to random
@lolli@norden.social avatar

Looking for a rule to change @test@norden.social annotation to #[Test] attribute. Could only find something for '@dataProvider' and '@testWith`. Any pointers?

pieceofthepie, to php
@pieceofthepie@n8e.dev avatar

Oh this is fun. I can't upgrade to 11 as it needs PHP-Parser 5+.

Which I can't use as needs 4+.

Not to mention this project itself needs PHP-Parser so that upgrade in of itself means work on my part.

Is this where I start using a PHAR?

sebastian, (edited ) to random
@sebastian@phpc.social avatar

#PHPUnit 10.5.12 and 11.0.5 are the first releases that use GitHub's Releases feature:

https://github.com/sebastianbergmann/phpunit/releases

ramsey, to php
@ramsey@phpc.social avatar

Since #PHPUnit no longer has expectWarning() and expectNotice(), how are folks handling these? #PHP :phpunit:

sebastian, to random
@sebastian@phpc.social avatar

I wrote about last week's #PHPUnit Code Sprint:

https://thephp.cc/articles/phpunit-code-sprint-march-2024

Thank you, @theseer, @localheinz, @sebastianheuer, @Schrank, and Frank!

sebastian, to php
@sebastian@phpc.social avatar

Over the last few months, I've been asked time and again:

"Sebastian, which PHP extension do you use to collect code coverage data?"

This question may sound simple, but to answer it I'm afraid I need to elaborate a little ...

https://thephp.cc/articles/pcov-or-xdebug?ref=mastodon

sebastian, to random
@sebastian@phpc.social avatar
scottkeckwarren, to random
@scottkeckwarren@phpc.social avatar

developers, sometimes when I run I receive 100s of errors (in my integration tests) that might only originate from 2 lines. Is there a way to consolidate these based on stack trace?

thepanz, to random
@thepanz@phpc.social avatar

Working on the v1 codebase and its test suite, make you realise how much work has been done on , and it simply works! Thank you @sebastian!

At the same time the legacy Doctrine v1 still manages OK-ish in the era of ! Still with no class namespaces and by implementing its own autoloading system! Is it probably from times? 🤔

Kudos to the original authors!
(Are they around here BTW?)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • khanakhh
  • mdbf
  • ethstaker
  • magazineikmin
  • cubers
  • rosin
  • thenastyranch
  • Youngstown
  • InstantRegret
  • slotface
  • osvaldo12
  • kavyap
  • DreamBathrooms
  • JUstTest
  • Durango
  • everett
  • tacticalgear
  • modclub
  • normalnudes
  • ngwrru68w68
  • cisconetworking
  • tester
  • GTA5RPClips
  • Leos
  • anitta
  • provamag3
  • lostlight
  • All magazines