Laravel उत्कृष्ट built-in testing support प्रदान करता है (PHPUnit पर, आधुनिक Pest विकल्प के साथ) साथ ही testing-specific helpers — एक test database, HTTP testing, authentication helpers, और fakes — जो applications को अत्यधिक testable बनाते हैं। Tests को feature tests (पूर्ण request flow) और unit tests (isolated logic) में विभाजित किया गया है।
Feature tests — पूर्ण request flow का परीक्षण
{
;
{
= ->(, [ // make a request to the app
=> , => ,
]);
->()
->([ => ]);
->(, [ => ]);
}
}
