Dear all,
I try also with Trait, and it work's but .... I think the problem with the 3 failed Test is "somewhere else" in the issue fork code. And NOT in the code done here to resolve this issue ...
What I have done ...
I modify the 3 files in repos/drupal/core/modules/file/tests/file_test/src/Form to use a new Trait:
- FileTestForm.php --> to use the Trait
- FileTestSaveUploadFromForm.php --> to use the Trait
- FileTestFormTrait.php --> the Trait itself
I have created a branch with this code here : https://git.drupalcode.org/issue/drupal-3368857/-/tree/3368857-remove-du...
Tests Works BUT ....
The following tests works:
Drupal\Tests\file\Functional\SaveUploadTest
Drupal\Tests\file\Functional\SaveUploadFormTest
Drupal\Tests\file\Functional\RemoteFileSaveUploadTest
BUT .... only if I test them a more recent issue fork
FYI, as I don't know HOW TO DEV in the latest 11.x Drupal version.... I choose a random other fork more recent to test (I choose 3478771-inputconfigurator-should-expose), and when I run them all works !!
Conclusion
I think something is "wrong" in the current issue fork (3368857) somewhere else
Perhaps is it possible to rebase ALL this issue fork with the latest core version ? And see if the Test works too ?
nico059 β made their first commit to this issueβs fork.