Explore tweets tagged as #phpunit
@stauffermatt
Matt Stauffer
7 minutes
Dang. Just got a notification from my tests on an old project that we won't be able to use /** @test */ on PHPUnit anymore? It's a sad day. (I know I can replace them with the #[Test] annotation, it's just.. these were such an integral part of my learning to test...)
0
0
2
@phpdaily_
PHP daily
2 hours
shipmonk/dead-code-detector: Dead code detector to find unused PHP code via PHPStan extension. Can automatically remove dead PHP code. Supports libraries like Symfony, Doctrine, PHPUnit etc. Detects dead cycles. Can detect dead code that is tested.
0
1
2
@VotrubaT
Tomas Votruba
11 days
Do you use PHPUnit and @rectorphp? Don't forget to enable PHPUnit code quality set 😎 There is nearly 50 rules that improve assert, data providers and mock calls to the best version possible.
3
5
61
@VotrubaT
Tomas Votruba
3 days
Did you know Behat has PHP config format? Just discovered, wow! Still, it's full of boiler plate code 😢 Instead of 500+ lines listing every feature/context files, I wish it would be like PHPUnit config - load test from directory X in single line. Then we'd have simple
2
1
10
@markusstaab
markus staab | @[email protected]
2 days
For a few days I am using the vacation from my primary job to improve #phpunit code coverage performance. After a few micro optimizations I finally found something substantial. Proof of concept is 33% faster
1
0
15
@markusstaab
markus staab | @[email protected]
25 days
In the near future #phpstan will error about your invalid #phpunit dataproviders data 🥰
0
4
28
@jordankdalton
Jordan Dalton
7 months
Want your PHPUnit test to make an assertion after each test, but before tearDown()? Checkout: assertPostConditions()
0
3
18
@garyclarketech
Gary Clarke
2 months
DAMA DoctrineTestBundle runs each Symfony / PHPUnit test in a transaction + rolls back at the end. So your tests stay fast and isolated, no schema rebuilds and no risk of one test polluting another. I use this technique in the Testing Symfony course (launching Oct 1st).
0
1
2
@garyclarketech
Gary Clarke
2 months
With PHPUnit data providers + yield, you can feed multiple datasets into one test: ✔ less code ✔ easy to read ✔ memory-efficient My Testing Symfony course launches on 1st October. Follow for updates.
0
3
35
@iDevMohammed
محمد | مطور مواقع 👨🏻‍💻
7 months
اذا تستخدم PHP وتبي تختبر الدوال اذا كانت تستخرج نفس المخرج المطلوب، فانصحك باستخدام PHPunit. الـ PHPUnit يعتبر Unit Testing يساعدك في اختبار الدوال قبل نشرها في production بشكل مباشر.
0
0
11
@nabilhassen08
Nabil Hassen
6 days
Discover how Pest modernizes PHP testing with expressive syntax, plugins, and fluent APIs, offering features PHPUnit never had, yet full compatibility. https://t.co/MHa6tBZSXT
1
0
6
@al3rez
Alireza Bashiri
4 months
This workflow will save you $1,000 (You don't need a QA engineer anymore) We're using this right now to build 100% test coverage for a complex trading platform MVP. Tools: Claude Code + Laravel + PHPUnit + RepoMix. Here's how it works: Use RepoMix to bundle your core library
8
0
5
@PovilasKorop
Povilas Korop | Laravel Courses Creator & Youtuber
2 months
Laravel tip. For new projects, if you choose None starter kit and wanna use Pest instead of PHPUnit, add a flag "laravel new --pest". Otherwise, installer will NOT ask you and will install PHPUnit. Which then means manual work to change to Pest. Don't ask me how I found out.
3
0
20
@garyclarketech
Gary Clarke
2 months
🟡 PHPUnit tip: use $this->markTestIncomplete() to outline tests before you’re ready to finish them. It keeps your test suite passing, helps you plan future cases, and reminds you where work is still needed. A small trick - but a really useful one.
0
1
4
@php4vs
PHP Tools for Visual Studio
1 month
PHP Tools 1.62 for @Code has been released, including Code Coverage support for PHPUnit tests🚀 See docs at https://t.co/aYQMoHsNPW and let us know how it works for you. This is our first public release of code coverage, and we're eager to improve/fix it for your setups!
3
12
46
@ashleyhindle
Ashley Hindle
3 months
Very sad I can't use Boost in this project, because it's trying to write PHPUnit tests even though we use Pest 😞 Then, just doesn't run the test? It says "Created a test... bye" 😧 Time to manually write guidelines manually like it's the 90s all over again!
6
1
46
@VotrubaT
Tomas Votruba
10 months
Testing tip: assert($object instanceof SomeType); Did you know assert() is disabled on most servers? Or is it? It should never be part of your tests suite as risky to miss important check. Use PHPUnit, Pest or another real assert call instead 👍
1
0
10
@garyclarketech
Gary Clarke
3 months
Want to test multiple inputs without repeating yourself? 🧪 One test method 🔁 Multiple inputs 🧾 Descriptive output with --testdox Data providers in PHPUnit keep your tests clean and readable. One of many topics in my upcoming Testing PHP course.
1
3
29
@garyclarketech
Gary Clarke
2 months
Mocking different return values across multiple calls in PHPUnit.. Use willReturnCallback() to return values based on arguments. 🧼 Clean 🎯 Predictable 🌍 Realistic Perfect when: ✔️ Same method called more than once ✔️ Inputs affect the output 📸 Example attached
3
2
31