Skip to content

getDefaultVfs() defined 3× with divergent structures — consolidate #36

Description

@remyperona

Summary

getDefaultVfs() is defined three times inside the package with divergent structures, and the precedence between them is confusing.

Where

  • VirtualFilesystemTestTrait.php — returns a wp-admin / wp-content / wp-includes / wp-config.php tree.
  • Integration/VirtualFilesystemTestCase.php — overrides it with a Tests/{Integration,Unit} tree.
  • Unit/VirtualFilesystemTestCase.php — overrides it with the same Tests/{Integration,Unit} tree.

Impact

  • The trait's default is effectively dead: both test cases (which use the trait) override it.
  • The two test-case copies are identical to each other — copy/paste duplication.
  • Consumers (e.g. WP Rocket) override getDefaultVfs() yet again, so it is unclear which layer is authoritative.

Proposed direction

Pick one source of truth. Options:

  • Keep a single default in the trait and remove the two identical test-case overrides

Either way, document that getDefaultVfs() is the intended single override point for consumers.


Found during an audit of WP Rocket's integration test suite, which depends on this package.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions