Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In issue #733192, it has been suggested that test code of the form:
$this->assertFalse(strcmp($target, $result), 'Assertion comment');
should be replaced by
$this->assertEqual($target, $result, 'Assertion comment');
The attached patch is the result of programmatically making such changes.
Comment | File | Size | Author |
---|---|---|---|
change-assertFalse-to-assertEqual.patch | 13.43 KB | pillarsdotnet | |
Comments
Comment #1
pillarsdotnet CreditAttribution: pillarsdotnet commentedI used the following commands to generate the patch:
Comment #2
pillarsdotnet CreditAttribution: pillarsdotnet commentedClicking on View details reveals that all tests passed.
Comment #3
tstoecklerIndeed.
The patch shows that there are still a lot of assertions using t(), but that's for another issue...
RTBC.
Comment #4
sunThis is a bug fix even. Because: http://de.php.net/manual/en/function.strcmp.php
Meaning:assertFalse(strcmp('foo', 'foo2')) == TRUE
Not true. But well, weird comparison technique anyway.
Comment #5
Dries CreditAttribution: Dries commentedCommitted to Git.