I was wondering if how I can verify if a ‘class’ has a Function.
assertClassHasAttribute does not work, it’s normal since a Function is not an Attribute.
I was wondering if how I can verify if a ‘class’ has a Function.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
When there’s not an assertion method provided by PHPUnit I either create it or use one of the lower-level assertions with a verbose message:
assertTrue()is as basic as you can get. It allows a great deal of flexibility because you can use any built-in php function that returns a bool value for your test. Consequently, when the test fails the error/failure message isn’t helpful at all. Something likeFailed asserting that <FALSE> is TRUE. That’s why it’s important to pass the second param toassertTrue()detailing why the test failed.