#Testing: Unified Expectations API with #PestPHP for Custom Fakes 🧪

#PHP #Laravel #testing fakes with unified API approach: transform $client->assertSent() into expect($client)->toHaveSent() for cleaner test code

🧵👇#TDD

Custom #expectations in #PestPHP let you modify test value on the fly within callbacks, creating visual symmetry between regular assertions and fake object testing
🔄 Seamlessly switch between regular and fake object expectations
🔹 Updated for #Laravel 12.0 and #Livewire 3.0 with multilingual support
🔹 Includes #PestPHP for testing, #LivewireAlerts for notifications, and #LaravelPint for code style
🔹 Simple installation process with comprehensive documentation

Building Custom Laravel Packages: From Basics to Advanced Features 🔧

🎯 #Laravel package development walkthrough shows implementation of method #caching using #PHP attributes and #composer initialization

🧪 Emphasizes #TDD approach using #Orchestra Testbench and #PestPHP for robust package testing

⚡ Covers essential concepts including service providers, dependency injection, and #caching implementation with practical examples

🔄 Demonstrates workflow optimization using local repository linking instead of direct deployment to #GitHub or #Packagist

🛠️ Includes setup of package structure, namespace configuration, and integration of facades and console commands

📚 Features comprehensive guide to #autoloading and package auto-discovery for seamless integration

Source: https://youtu.be/QsA5mdzKXLA?si=tEfLmqATb2MKqdrp

How To Build a Laravel Package 📦

YouTube

🔄 #PHP Core Updates
#PHP 8.4 RC3 available for testing, final release expected Nov 21
• Security updates released for PHP 8.1.30, 8.2.24, and 8.3.12
• New RFC proposals for closure support in constant expressions and persistent curl handles

🛠️ Tools & Frameworks
#Composer 2.8.0 launches with patch-only updates and new command options
#PestPHP v3 introduces mutation testing and arch presets
#APIplatform 4 released with official #Laravel support
#Symfony celebrates 19th anniversary with version 7.2 updates

🏢 Community & Foundation
#ThePHPFoundation joins #opensource pledge
• New Web Services Tool for PHP-FPM delivered
• Core roundup series relaunched in partnership with PHP.Watch
• Foundation actively seeking new sponsors

🎯 Development Tools
#PHPStorm 2024.3 EAP launched with full PHP 8.4 support
• New profiling extension with web UI: php-spx
• imliam/cpx introduces npx-like functionality for PHP
• Multiple new testing and code quality tools released

https://blog.jetbrains.com/phpstorm/2024/10/php-annotated-october-2024/

PHP Annotated – October 2024 | The PhpStorm Blog

Welcome to the October edition of PHP Annotated! This recap is carefully handcrafted and brings you the most interesting developments in the PHP community over the past couple of months, so you don’t

The JetBrains Blog
A Guide to Architecture Testing Presets in Pest 3

Discover how Pest 3 simplifies architecture testing with pre-configured presets, making it effortless to enforce best practices and maintain code quality in your projects.

Effortlessly test all #php #Laravel routes with pest-plugin-route-testing 🚀

✅ Verify all routes
🔍 Test specific routes with wildcards
🔗 Handle model bindings
🛠️ Customizable assertions

#pestphp #testing

https://github.com/spatie/pest-plugin-route-testing/tree/main

GitHub - spatie/pest-plugin-route-testing: Make sure all routes in your Laravel app are ok

Make sure all routes in your Laravel app are ok. Contribute to spatie/pest-plugin-route-testing development by creating an account on GitHub.

GitHub
Přijde vám #PHPUnit moc konzervativní resp. neinovativní anebo pomalý? Zkuste #PestPHP a možná budete nadšení stejně jako já 😎 viz https://pestphp.com
Pest | The elegant PHP testing framework

Pest is a testing framework with a focus on simplicity, meticulously designed to bring back the joy of testing in PHP.

Spent today converting a project from #phpunit to #Pestphp. Took a while to get set up with the Pest config file, but much prefer the readability and the built in parallel testing.

Haven't managed to get the `--dirty` option to work yet though.

Inside the Sail container I get no output. Outside the container I get an error saying git is required...

I wrote a little blurb about my new found fondness of testing in PHP. Previously, almost a decade ago, getting tests to work was a pain. Golang was such a breath of fresh air.

Today, in 2024, testing on PHP is good actually if you use Pest

https://javorszky.co.uk/2024/05/06/pest-in-php-is-good-actually/

#weblogpomo2024 #php #Pestphp

Pest in PHP is good, actually!

Pest is a testing framework for PHP you can install via composer that makes writing your tests a lot easier than you think!

Gabor Javorszky