flysystem icon indicating copy to clipboard operation
flysystem copied to clipboard

Adding and ensuring more dedicated tests

Open tinect opened this issue 11 months ago • 4 comments

Feature Request

Using different adapters, I always see different behaviours. This could be avoided, if there were more dedicated tests in AdapterTestUtilities.

  • [x] fileExists should not be true, if it is a directory (#1789)
  • [x] directoryExists should not be true, if it is a file (#1789)

Currently, It is not clear what should happen, when:

  • [x] move/copy any file onto any other existing file? https://github.com/thephpleague/flysystem/pull/1808
    • a few throw exceptions, some just overwrite
  • [x] move/copy any file to the same destination? https://github.com/thephpleague/flysystem/pull/1808
  • a few throw exceptions, others remove the file, others just updating the visibility
  • [ ] deleteDirectory which does not exist
    • a few throw exceptions, others ignore it

tinect avatar Mar 10 '24 14:03 tinect

@frankdejonge is this something we can talk about for v4?

tinect avatar Apr 29 '24 20:04 tinect

From docs https://flysystem.thephpleague.com/docs/usage/filesystem-api/

Moving and copying are both deterministic operations. This means they will always overwrite the target location, and parent directories are always created (if and when needed)

The other 2 points remain though.

SamMousa avatar Aug 08 '24 08:08 SamMousa

Oh, I forgot the page. but yes, then it is not valid for several adapters.

tinect avatar Aug 08 '24 14:08 tinect

Those could be files as bugs and be fixed without major release i guess?

SamMousa avatar Aug 08 '24 15:08 SamMousa