Chris Gmyrchrisgmyr.dev·Sep 1, 2024Colocating Tests in LaravelIn a typical Laravel application, tests are housed in the /Tests directory and spread across /Tests/Feature and /Tests/Unit, which mimics the structure within the app/ directory. While this is a great starting point for apps, it quickly breaks down w...Discuss·2 likes·439 readsLaravel
David Carrdcblog.dev·May 3, 2024PHP use an enum for FiltersI have a class that allows filtering based on an option, I need a way to accept options and also reject invalid options. In the past, I would reach for a switch statement, or more recently a match statement. But an enum is better suited for this task...Discuss·69 readsFilter
Sean Kegelseankegel.com·Feb 25, 2024Fix Flaky Tests with Pest RepeatI recently ran into an issue with a flaky test in our CI process. Most of the time, it would pass, but when it failed, it meant running all the tests again and hoping it would pass on the next try. When I was finally fed up enough with the waiting, I...Discuss·3 likes·953 readsPHP
Tresor Kasendakasenda.hashnode.dev·Jan 4, 2024Chapter 11: Optimizing Tests in PestPHPIn this chapter, we'll delve into various optimization techniques offered by PestPHP to help developers write efficient, high-performing tests. Optimization is crucial for maintaining a responsive and productive testing environment, especially as you...Discuss·9 likes·35 readsMastering PestPHP: A Comprehensive Guide to Unit Testing PHP ApplicationsLaravel
Tresor Kasendakasenda.hashnode.dev·Dec 26, 2023Chapter 8: Test Filtering in PestPHPIn this chapter, we'll explore how PestPHP allows you to filter and run specific tests, providing you with a focused and efficient testing experience. Test filtering is a valuable feature, especially when dealing with large test suites, enabling you ...Discuss·46 readsLaravel
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·87 readsLaravelFeature Testing
Tresor Kasendakasenda.hashnode.dev·Dec 19, 2023Chapter 7: Skipping Tests in PestPHPIn this chapter, we'll explore how PestPHP allows you to skip tests temporarily. There are situations during the development process when you might need to disable specific tests, and PestPHP provides a straightforward way to achieve this without rem...DiscussLaravel 5
Tresor Kasendakasenda.hashnode.dev·Dec 16, 2023Chapter 6: Continuous Integration with PestPHPIn this chapter, we'll explore how PestPHP integrates with continuous integration (CI) systems, allowing you to seamlessly incorporate testing into your automated build pipelines. Continuous integration ensures that your tests are run automatically w...Discuss·6 likesMastering PestPHP: A Comprehensive Guide to Unit Testing PHP ApplicationsLaravel
Tresor Kasendakasenda.hashnode.dev·Dec 7, 2023Chapter 5: Handling Exceptions in PestPHP - Ensuring Graceful Behavior under StressIn this chapter, we'll explore how PestPHP handles exceptions, providing you with the tools to check whether specific exceptions or errors are thrown during testing. This capability is crucial when testing the behavior of your PHP code, especially in...Discuss·1 likeLaravel
Tresor Kasendakasenda.hashnode.dev·Nov 28, 2023Chapter 4: Leveraging Datasets in PestPHP - Effortless Testing for Multiple ScenariosIn this chapter, we'll explore the use of datasets in PestPHP, a feature that allows you to define an array of test data, enabling PestPHP to automatically run the same test for each set. This is particularly valuable when you want to ensure that you...Discuss·2 likes·76 readsMastering PestPHP: A Comprehensive Guide to Unit Testing PHP ApplicationsLaravel