Laravel 7 min read

Inherited Laravel application with no tests: where I would start

Inherited a Laravel application with no tests? Adam Dawson explains how to protect critical workflows, plan a safe takeover and make changes with confidence.

Inherited Laravel application with no tests: where I would start

If you have inherited a Laravel application with no meaningful automated tests, every change can feel expensive. A small fix touches an invoice total, an approval step or a customer record, and someone has to click through the system hoping nothing else broke.

I would start by identifying the business workflows that need protection, then build a small, repeatable set of checks around them. The aim is to make the next change easier to assess. An empty test folder alone is not enough evidence to justify replacing software the business relies on.

What does “no tests” actually mean?

Before scoping Laravel codebase rescue work, I would inspect the existing checks. There may be example tests that prove the application boots, developer scripts that are never run, or a useful suite that stopped working after an environment change.

Those are different starting points. I would also ask how releases are checked today. A spreadsheet of manual checks can contain valuable knowledge, particularly where the rules live in someone's head rather than in documentation.

The first output should be a short account of what is covered, what is unknown and which gaps could affect money, customer access or daily operations.

Choose the first workflow by business risk

I would ask the person using the system to show me a normal working day. Which action would cause the most trouble if it silently went wrong? That might be approving an invoice, allocating stock, submitting a customer request or generating a report used for payment.

For a hypothetical invoice approval workflow, the first checks might be:

  • An authorised staff member can approve an eligible invoice.
  • The saved approval belongs to the correct customer and invoice.
  • A user without approval permission cannot complete the action.
  • An already approved invoice does not trigger the same action again.
  • The expected notification is requested only after a successful approval.

These are example requirements to confirm with the business. They are not claims about a client's system. Naming the outcomes makes it easier to agree a useful scope than asking for “more test coverage”.

Make the testing environment safe and repeatable

Before running an unfamiliar suite, I would verify the database, storage, mail and integration settings it actually uses. Tests that reset tables or send requests must be separated from live customer data and production credentials.

Laravel supports a dedicated .env.testing file and configuration in phpunit.xml. I would check both, along with any cached configuration, rather than assume the word “testing” guarantees isolation. The framework's testing environment documentation explains those mechanisms. Use the documentation matching the application's installed Laravel version.

A clean checkout should be able to start the checks with documented setup steps. I would use synthetic records that represent relevant customer types and statuses, keeping production personal data out of routine tests.

Database reset behaviour also needs deliberate configuration. Laravel provides tools such as RefreshDatabase, factories and database assertions in its database testing documentation. These belong against a disposable test database. If the application depends on database-specific behaviour, I would include relevant checks against its actual database engine.

Start with tests that exercise the complete action

For inherited business software, I would usually start with a feature test around the selected request or workflow. Laravel distinguishes these from isolated unit tests in its testing guide.

A check that the approval page returns a successful response is useful, but it cannot tell me whether the correct invoice changed. I would also inspect the saved state, permissions and side effects that matter to the agreed requirement.

Once the workflow has protection, a smaller unit test can help with a complicated pricing rule or date calculation. The order depends on where the uncertainty sits. I would avoid spending the initial budget testing trivial methods while the important customer action remains unchecked.

Need someone to take over your Laravel application? Tell me what the system does, what you need to change and which workflow you cannot afford to break. I offer inherited codebase reviews and stabilisation planning as part of my Laravel development and ongoing support service.
Discuss your Laravel app with Adam

Record existing behaviour without preserving known bugs

An inherited application may contain undocumented rules. I would compare what the code does with what the business expects before turning its current output into a test.

Suppose an old report rounds each line separately, but the finance team expects rounding at the total. A test that copies today's figure could protect the wrong rule. That discrepancy needs a decision, followed by a test for the agreed behaviour.

Where behaviour is unclear, I would record the uncertainty. Where a defect is confirmed, I would reproduce it with a focused failing check, make the fix and keep the check as protection against that regression.

Separate application checks from external integration checks

Tests should not routinely send real customer emails, create live invoices in another platform or take payments. Laravel provides fakes for mail, notifications and queues in its mocking documentation. They can verify that the application requests an expected side effect without performing it.

A fake does not prove an email reaches an inbox or an external API accepts the payload. I would plan a separate integration check using the provider's sandbox where available, with clear test data and expected results.

For queued work, checking that a job was dispatched is only one part of the workflow. The job's processing behaviour needs its own checks. If jobs are already getting stuck, my article on investigating Laravel queues covers a related operational problem.

Turn the checks into a practical release gate

A suite that only runs on one developer's laptop offers limited protection. I would document how to run it and, where the project supports it, connect the agreed checks to the deployment process.

The handover should distinguish automated checks from the manual smoke test still needed after release. A permission test cannot confirm the deployed server's email credentials; an API test cannot judge whether a mobile form is usable.

I would also record what the first phase deliberately leaves uncovered. A green result means the checks passed for their inputs and assertions. It is not a guarantee that every business rule or production configuration is correct.

What should you ask for in a Laravel takeover quote?

A useful proposal should name the initial workflows, explain how the test environment will be isolated and identify the deliverables. I would expect a setup guide, repeatable checks, a list of unresolved risks and a recommendation for the next change.

Access to the repository, dependency versions, deployment notes and an example of the current problem will help scope the work. A short demonstration by someone who uses the application is valuable too.

You do not need to commission a complete test suite before fixing one urgent problem. You do need to agree which behaviour the fix must preserve and how that will be checked.

Can an inherited Laravel application improve without a rebuild?

Often there is a sensible path: understand one important workflow, protect it, make a controlled change and expand the checks as development continues. Whether that is appropriate depends on the condition of the application and the business requirements.

A rebuild needs its own evidence, including the cost of moving data and reproducing existing rules. If an upgrade is also due, I would coordinate the testing work with an upgrade plan for a business-critical Laravel application.

I am Adam Dawson. My Laravel support service includes inherited codebase takeover, documentation and stabilisation planning. If your application has become difficult to change, send me the workflow you want to improve and the problem blocking it.

Make the next change easier to trust Start with a conversation about the part of your application that matters most to the business.
Scope your Laravel takeover Explore Laravel support

Need a hand with this?

Work directly with me on an existing Laravel application, from a focused assessment to ongoing development.

Talk directly to Adam

Share this article

Back to Blog