Lukaslukasnotes.dk·Mar 3, 2024Accidentally deleting Laravel database when running tests? Here is what to do insteadFor a long time in my first years of dev journey I would accidentally wipe out the local database when I would run tests. This would because I have cached the config for unspecified reasons. After falling into the same pit hole for enough times, I fi...DiscussWhat have I learned today...Laravel
Sanjay Singhaniacapitalnumbers.hashnode.dev·Jan 22, 2024A Guide on PHP Debugging Tools & Techniques for 2024In the dynamic landscape of web development, PHP remains a robust and widely used scripting language. While PHP offers flexibility and power, it is susceptible to bugs, glitches, and challenges that can impact the smooth execution of your projects. A...Discuss·37 readsPHP
Saiful Alamblog.msar.me·Dec 23, 2023Testing in LaravelLaravel's robust framework caters to a developer's desire for efficiency and elegance. But what about assurance, the quiet confidence that your code won't crumble under real-world pressure? That's where testing becomes your knight in shining armor. T...Discuss·1 like·69 readsLaravelFeature Testing
Chris GmyrProchrisgmyr.dev·Sep 26, 2023Improve Your Productivity While Utilizing Laravel MocksLaravel has numerous test helpers and mocks within the framework, which is fantastic. However, I see other engineers getting caught up on debugging issues when they arise. The Laravel docs show this as an example Queue::assertPushed(function (ShipOrd...Discuss·409 readsLaravel
Geni Jahoblog.genijaho.dev·Sep 17, 2023Upgrading to Laravel 10, PHPUnit 10, and Pest 2We're upgrading from Laravel 9 to 10, and PHPUnit 9 to 10, and, if all goes well, we'll top it off by migrating to Pest, the latest version. To keep the positive vibes on I'll skip an upgrade from PHP 8.1 to 8.2, just because I don't want to restart ...Discuss·653 readsRectorPHP
Amadeusz Annissimoannissimo.com·Aug 25, 2023Laravel's HasLocalePreference: Writing PHPUnit Tests for Notifiable's Default LocaleBackground: How to define default Locale for Notifiable Since Laravel 5.7.7, you can set the preferred locale on a Notifiable. In other words, you can define the default locale that will be used for every Notification (or email) sent to a given User ...Discuss·68 readsLaravel
Mohamed Kamelmohamedkamel.hashnode.dev·Aug 7, 2023How to boost your Laravel and PHPUnit testing performancePHPUnit is a testing framework that followed the xUnit framework which is a testing framework that is originally written by Kent Beck. "x" refers to the language such as PHPUnit for PHP or JUnit for Java, and NUnit for .NET, and Unit is the concept. ...Discuss·1 like·174 readsPHP
James Rossflukedit.hashnode.dev·Aug 1, 2023Testing invalid form validation in Laravel using PHPUnitIntroduction One thing I have noticed when reviewing code relating to form validation is that the focus is predominantly on testing the true path, or best-case scenario. By this, I mean that we have a set of business rules that the request must meet,...Discuss·63 readsform validation
Moathmoath.dev·Jul 4, 2023Fake Timeout Exceptions in LaravelIf you're developing a Laravel app that interacts with external services, it's important to ensure that it can handle timeout exceptions gracefully. Fortunately, testing timeout exceptions in your Laravel app is straightforward using the Laravel HTTP...Discuss·613 readsPHP
Bruce Wellsblog.phpfui.com·Apr 14, 2023PHP Inheritance ExplainedIn my last article, I explained OO (object oriented) programming does not necessitate inheritance. A common mistake among developers is to assume you need inheritance to do OO programming. But inheritance is an important concept if used correctly. Th...Discuss·72 readsPHP