Problem/Motivation

In #3131088: Replace assertions involving calls to file_exists with assertFileExists()/assertFileNotExists() or assertDirectoryExists()/assertDirectoryNotExists() we replaced is_dir() with assertDirectoryExists() in tests. In InstallerCustomConfigDirectoryCreateTest an error crept in:

    $this->assertDirectoryExists($this->publicFilesDirectory . '/config_custom') && is_dir($this->publicFilesDirectory . '/config_custom');
...
    $this->assertDirectoryExists($sync_directory) && is_dir($sync_directory);

Proposed resolution

Remove the && is_dir(...) fragments.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 3133103.patch1.04 KBlongwave

Comments

longwave created an issue. See original summary.

longwave’s picture

Status: Active » Needs review
StatusFileSize
new1.04 KB
catch’s picture

Status: Needs review » Reviewed & tested by the community

Good spot.

  • xjm committed 6f4f640 on 8.9.x
    Issue #3133103 by longwave: InstallerCustomConfigDirectoryCreateTest has...
xjm’s picture

Title: InstallerCustomConfigDirectoryCreateTest has bad assertions » [8.9 only] InstallerCustomConfigDirectoryCreateTest has bad assertions
Status: Reviewed & tested by the community » Fixed

I almost said "surely the intent was to put that inside the assertion" but the contents of the is_dir() are the same as those of the assertions.

This error appears to exist only in 8.9.x, not in 8.8.x, 9.0.x, or 9.1.x. I confirmed that these are the only two cases, also:

[ibnsina:drupal | Sun 19:12:18] $ grep -r "assertDirectoryExists" * | grep "is_dir"
core/tests/Drupal/FunctionalTests/Installer/InstallerCustomConfigDirectoryCreateTest.php:    $this->assertDirectoryExists($this->publicFilesDirectory . '/config_custom') && is_dir($this->publicFilesDirectory . '/config_custom');
core/tests/Drupal/FunctionalTests/Installer/InstallerCustomConfigDirectoryCreateTest.php:    $this->assertDirectoryExists($sync_directory) && is_dir($sync_directory);

Committed to 8.9.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.