FileFieldTestBase contains a very useful methods for testing work with files. But not all test classes can inherit FileFieldTestBase. Example:

  • JSB tests,
  • BTB tests which inherit the other classes

Issues where this will help to avoid unnecessary c/p code:

CommentFileSizeAuthor
#3 interdiff-2-3.txt737 bytesAnonymous (not verified)
#3 2919352-3.patch12.84 KBAnonymous (not verified)
#2 2919352-2.patch12.78 KBAnonymous (not verified)

Comments

Anonymous’s picture

vaplas created an issue. See original summary.

Anonymous’s picture

Anonymous’s picture

StatusFileSize
new12.84 KB
new737 bytes

Fixing the error after testing in #2809503: Convert AJAX part of \Drupal\file\Tests\FileFieldWidgetTest to JavascriptTestBase. Although the mentioned issue uses a slightly different version of the trait, but it is out of scope.

Anonymous’s picture

Status: Needs review » Closed (duplicate)

It seems better to do this in #2870448: Convert web tests to browser tests for file module. Because:

  1. This is a just direct transfer methods from the class to the trait.
  2. We will immediately get a good test coverage.