Laravel بہترین built-in testing support فراہم کرتا ہے (PHPUnit پر، جدید Pest آپشن کے ساتھ) اور testing-specific helpers — ایک test database، HTTP testing، authentication helpers، اور fakes — جو ایپلیکیشنز کو بہت زیادہ testable بناتے ہیں۔ Tests کو feature tests (مکمل request flow) اور unit tests (isolated logic) میں تقسیم کیا جاتا ہے۔
مکمل request flow کو test کریں — Feature tests
{
;
{
= ->(, [ // make a request to the app
=> , => ,
]);
->()
->([ => ]);
->(, [ => ]);
}
}
