Some packages, e. g. `tm/tooly-composer-script`, are using the composer classes to e. g. create symlinks or perform other file operations. While there's only a `copyThenRemove()` method this commit introduces a new `copy()` method. `copy()` behaves the same as the copy part of `copyThenRemove()` did with one exception: it returns `true` on success and `false` on failure. Copying a directory may lead to a `false`, while the whole directory or some of its files couldn't been copied. To ensure backwards compatibility `copyThenRemove()` calls `copy()` now. This commit also adds the necessary tests.
any tests that use the filesystem should have their own unique directory, as we run our test suite in parallel and
cleanup of tests (removing directories) should not interfere with currently running tests
The testsuite didn't run through for me because the php symlink() function
was missing.
It is only available on Windows Visa/Server 2008 or higher.
This commit fixes the issue by checking if the method exists, and if not,
marks the test as skipped because of a non-matching precondition.