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 6134943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:25:08+00:00 2026-05-23T17:25:08+00:00

I want to pass tests which get the following: This test did not perform

  • 0

I want to pass tests which get the following: “This test did not perform any assertions”

I know I could add something like assertTrue(true) however is it possible to add something to the config to make these tests pass cleaner?

I’m pretty sure this only happens since version PHPUnit 3.5.0 with the introduction of
--strict

  • 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-23T17:25:09+00:00Added an answer on May 23, 2026 at 5:25 pm

    Edit: You’ve got a few choices depending on which version you’re using, whether you want to ignore all risky tests or just a few, and if you want it to be permanent or temporary.

    Prior to 5.6, if you didn’t want to add bogus assertions to all your tests, you had to avoid passing --strict to PHPUnit or add strict="false" to your phpunit.xml. The point of this option is to "Mark a test as incomplete if no assertions are made."

    At some point, PHPUnit added the related --dont-report-useless-tests command-line switch and beStrictAboutTestsThatDoNotTestAnything="false" config option. I haven’t checked if they are replacements or additional fine-grained versions.

    The above options affect all risky tests. Using them will leave you open to accidentally writing tests without assertions. The following new options are safer as you have to purposefully mark each risky test that you wish to allow.

    PHPUnit 5.6 added the @doesNotPerformAssertions annotation to mark individual test cases as "not risky" even though they perform no assertions.

    /**
     * @doesNotPerformAssertions
     */
    public function testWithoutAsserting() {
        $x = 5;
    }
    

    PHPUnit 7.2 introduced TestCase::expectNotToPerformAssertions() which does the same thing.

    public function testWithoutAsserting() {
        $this->expectNotToPerformAssertions();
        $x = 5;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to pass a url like http://example.com/test?a=1&b=2 in url segment of codeigniter. I'm
I want to pass an ImageIcon instance by value as we know that by
I get errors like this when attempting to run unit tests under App Engine
I tried to install python below way. But this did not work. This take
I want to test a MVC action method which accpets a custom class parameter
I generate my jqgrid from model class which I pass into view. I get
I've a following method Test which accepts a params list: Public void method Test(params
I want to write a test case which will test a list of functions.
I want pass a class-instace to a method of an other and be sure
My data is just number, I want pass it from VC1 to VC2 for

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.