Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3808870
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T15:12:59+00:00 2026-05-19T15:12:59+00:00

The way we’ve been developing, many of our PHP files are included only with

  • 0

The way we’ve been developing, many of our PHP files are included only with the expectation that they will output content; no methods are called, etc. My question is, what’s the “correct” way to test this with PHPUnit? Should I have the require placed in the setUp so that it waits till then to run, or is that considered bad mojo?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T15:13:00+00:00Added an answer on May 19, 2026 at 3:13 pm

    That’s about the only way you can test it. I assume you’re planning to use output buffering to capture the content produced so that you can check it against expectations.

    The best way is probably to refactor your code so as much work as possible is being done in self-contained classes / functions that return results to the caller, suitable for being tested from PHPUnit in a more conventional way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

the way i have it is that I set up an insert command which
Any way I can intercept and modify javascript that gets loaded through ajax? I
The way I currently handle this is by having multiple config files such as:
the way I have my portfolio setup is so that if a potential employer
Way back in the days when delicious was just del.icio.us, I had assumed that
The way we have to update our site now is to create a copy
secure way to pass large string values between pages, i have used PHP in
The way this is set up, it will pull up results for multiple words
Any way to realize emacs keybind on Qt Creator (QTC)? Some possibilities: emacskeys but
the way i found for using custom fonts on my android app is using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.