Please use PHPUnit test or other framework to test, they have a lot of assertion way,
But what happens if testers use Asserttrue to implement assertions?
I want the test to work and determine if it's consistent with the assertion.
But the details of the impact may appear in the resulting report and cannot express the assertion result.
For example, to assert whether an array has an AB key, use the
Asserttrue (Isset ($arr [' AB ']))
But according to the official assertion method should be used
Assertarrayhaskey ($arr [' AB '])
Here are some typical examples:
Asserttrue ($x ==1)
Asserttrue (Is_array ($x))
Asserttrue (Empty ($x));
Asserttrue (Is_object ($x));
Asserttrue (count ($x) = = 100);
$ids = GetIDs ();
$flag = true;
foreach ($ids as $id) {
if (!is_nmerical ($id)) {
$flag = false;
}
}
Asserttrue ($flag);
..........
.........
Look at the total feeling where something is wrong, if it can be true to solve seemingly no problem, but in fact Xunit system testing Framework provides so many assertions method?
What happens if you use true to assert the consequences?
Reply to discussion (solution)
For a more intuitive look at what's wrong
Here's a two-sheet contrast chart. It's true to assert that you can quickly locate a problem in that place?
One is a different form of assertion
For a more intuitive look at what's wrong
Here's a two-sheet contrast chart. It's true to assert that you can quickly locate a problem in that place?
One is a different form of assertion
Thank you, it sure did affect the accuracy of the test report.
Also do you know codeception This test framework? I want to ask someone to consult this framework of the specific, the official website of the document initially looked at, but the depth of the point is still not touch, the main combination of YII2 to do
For a more intuitive look at what's wrong
Here's a two-sheet contrast chart. It's true to assert that you can quickly locate a problem in that place?
One is a different form of assertion
Thank you, it sure did affect the accuracy of the test report.
Also do you know codeception This test framework? I want to ask someone to consult this framework of the specific, the official website of the document initially looked at, but the depth of the point is still not touch, the main combination of YII2 to do
Sorry had no contact with SimpleTest and PHPUnit codeception.