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

  • Home
  • SEARCH
  • 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 1039191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:04:09+00:00 2026-05-16T15:04:09+00:00

Which action/method is in PHPUnit equal to in simpleTest: $this->UnitTestCase(‘message …..’) Edit: Sorry for

  • 0

Which action/method is in PHPUnit equal to in simpleTest:

$this->UnitTestCase('message .....')

Edit: Sorry for my mistake


I think what I asking about not exist in simple test directly its just our extended class.

But this method display message in begining of test- how its done with PHPUnit?

Thanks

  • 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-16T15:04:09+00:00Added an answer on May 16, 2026 at 3:04 pm

    I’m not a SimpleTest expert, but as far as I can tell that’s the constructor for the UnitTestCase class. The equivalent in PHPUnit is PHPUnit_Framework_TestCase; you create your own tests by subclassing that and defining test methods. See the PHPUnit docs on writing tests for a quick howto and more info, but briefly, this is a complete PHPUnit test:

    class MyTest extends PHPUnit_Framework_TestCase {
        public function testSomething {
            $this->assertTrue(MyClass::getSomethingTrue());
        }
    }

    Update: to answer the revised question, the primary way to display messages in PHPUnit is on assertion failure. Every assert* function comes with an optional $message argument at the end, which you can use to display a custom message when that assertion fails.

    If you want to always display a message, without having to fail an assertion, then you might try a straightforward print statement. It’ll be interspersed with the test output, so this may not be the best (or nicest-looking) way of accomplishing what you want, but it’ll certainly dump text to a console, which is what you seem to be asking.

    If you’re looking for some advanced debugging during unit-testing, you may also want to consider a logging framework of some kind (or even just a custom function that opens a file, prints to it, and closes the file again). That way, you preserve the integrity of the test output, but still get extra custom messages wherever you want them during your tests.

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

Sidebar

Related Questions

My application makes several calls to an Action method (ASP .NET MVC) which returns
In a php-script i have a form, method is post, action-attribute is empty, which
I have got an action which takes in an argument it goes like this
I have an ASP.NET MVC action method which uses model binding to accept a
How do you get the object parameters, which action method was called with at
I have a website that uses one Action method which passes a pagename to
I have a MVC action method from which I am returning the data as
I have the following action method that builds a drop down list which is
I have a JavaScript function which redirect to Asp.net MVC action method. [AcceptVerbs(HttpVerbs.Post)] public
I have an iframe and the source is a controller action method. This action

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.