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.
The setUp() method in the test class UserPictureTest (UserPictureTestCase in Drupal 7) is checking that the user picture directory exists and is writable.
$pic_check = file_prepare_directory($picture_path, FILE_CREATE_DIRECTORY);
$this->_directory_test = is_writable($picture_path);
$this->assertTrue($this->_directory_test, "The directory $picture_path doesn't exist or is not writable. Further tests won't be made.");
The check is actually made twise as "file_prepare_directory()" is also checking if the directory is writable.
The assertTrue call after this will check that the $this->_directory_test variable is TRUE, and it should be true if the picture directory is writeable.
Tho the message tells the user that the directory doesn't exists or is not writeable and that further tests won't be made.
I have made two patches, one for D8 and one for D7.
Comment | File | Size | Author |
---|---|---|---|
#9 | negative-test-message-d7.patch | 852 bytes | leopathu |
negative-test-message.d7.patch | 850 bytes | anon | |
negative-test-message.d8.patch | 986 bytes | anon | |
Comments
Comment #2
anongaah, testbot..
EDIT: Ok I learned my lesson, I will use the "-do-not-test.patch" next time..
Comment #2.0
anonUpdated issue summary.
Comment #5
jhedstromComment #6
vmartins CreditAttribution: vmartins commentedComment #7
vmartins CreditAttribution: vmartins commentedComment #8
lokapujyaNo such test anymore on D8.
Comment #9
leopathu CreditAttribution: leopathu commentedHi,
I think, This patch will pass the testing
Comment #10
lokapujyaAs written in the 3rd person "exist" should actually be "exists".