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.
Problem/Motivation
As title
Proposed resolution
For example:
- $this->assertFalse(file_exists($file_path), 'Stale file is deleted.');
+ $this->assertFileNotExists($file_path, 'Stale file is deleted.');
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#21 | interdiff_19-21.txt | 1.03 KB | Spokje |
#21 | 3131088-21.patch | 60.56 KB | Spokje |
#9 | 3131088-9.patch | 59.36 KB | Spokje |
Comments
Comment #2
longwavefile_exists() also returns TRUE for directories, so the tests can be more accurate here about what they are looking for.
Comment #3
longwaveComment #4
msutharsComment #5
msuthars@longwave Patch looks fine for me. I reviewed and tested it and it working as expected.
Comment #6
catchNeeds a reroll.
Comment #7
SpokjeReroll of #3 against latest
9.1.x
Comment #8
SpokjeCrap, missed a few, new reroll coming shortly.
Comment #9
SpokjeRe-reroll of #3 against latest
9.1.x
Comment #10
SpokjeBack to RTBC after TestBot Greenness.
Comment #11
catchCommitted/pushed to 9.1.x and 9.0.x, thanks!
Needs a reroll for 8.9.x
Comment #14
SpokjeReroll of #9 against latest
8.9.x
Comment #15
SpokjeTesBot Greenness on D8.9.x as well.
Note:
There are 2 instances of
$this->assertTrue(file_exists($filename), $message);
left.In
Drupal\simpletest\Tests\WebTestBaseInstallTest
andDrupal\simpletest\Tests\SimpleTestTest
, both are based onDrupal\simpletest\WebTestBase
which apparently doesn't supportassertFileExists/assertFileNotExists
Comment #16
SpokjeRemoved Reroll tag
Comment #17
longwaveI don't think this exists in SimpleTest - the patch is still green because this won't be called any more by any core tests, but contrib might still use it.
Comment #18
Spokje@longwave Good catch! Got a bit too enthusiastic there...
I've removed it from this patch.
Comment #19
SpokjeGrmbl, #3125391 got in and made my patch invalid.
Reroll against latest
8.9.x
Comment #20
longwaveThis isn't quite right, this needs to become
assertDirectoryExists()
Same here.
Comment #21
SpokjeRight...
Seems like yesterday wasn't my best rerolling day ever.
@longwave You're absolutely right with your comments in #20
I've went through patch #19 but (of course) those two seem to be the only ones I've messed up.
Not sure why they weren't detected in the patch in #14 which included this "wrongness" and still turned out green.
Anyway: New patch addressing comments in #20 attached.
Comment #22
longwaveNo worries, thanks for working on this - all looks good now.
Comment #24
catchCommitted/pushed to 8.9.x, thanks!
Comment #25
longwaveThe 8.9.x patch here has some bad code, opened #3133103: [8.9 only] InstallerCustomConfigDirectoryCreateTest has bad assertions to address this.