[BUGFIX] FAL does not copy subfolders cleanly

If full structures with sub folders are copied around in FAL
local driver, sub folders are not correctly created in the
target directory.

This is detected in unit tests after recent vfsStream updates in
ext:phpunit.

The patch adds a flag to the Iterator code to also include
directories to fix the issue.

Additionally, the existing two unit tests also tested multiple other
methods of the local driver and are functional tests. The patch moves
those two tests to the functional section and adds three simple unit
tests with correct mocking instead.

Change-Id: I30d3c8bd5c6538b3fe23405d97bcddff6c1ff405
Releases: 6.2, 6.1, 6.0
Resolves: #50472
Reviewed-on: https://review.typo3.org/22596
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
(cherry picked from commit b0f8bb0d15106b6f3ee2c5b3b033cbc3e1b635e2)
Reviewed-on: https://review.typo3.org/22606
[BUGFIX] FAL wrong \RecursiveIteratorIterator usage

If using \RecursiveIteratorIterator on \RecursiveDirectoryIterator,
flag SELF_FIRST must be used, otherwise only leaves (files) and not
also directories are returned. This behavior is a bit dependent on
the PHP version used, younger versions (> 5.3.3 seem to do it
correctly).

Furthermore, in copyFolderWithinStorage() $itemSubPath contains
the "relative" path part and not only the node name, checking
equality to "." or ".." fails then if handling sub directories.
So, directories may be created multiple times, resulting in mkdir()
warnings. This is fixed by getting the node name itself and using
that for comparison.

Resolves: #50476
Releases: 6.2, 6.1, 6.0

Change-Id: Ifac4b28f4e02ec8a9bf5891739cf66c1e1074af9
Reviewed-on: https://review.typo3.org/22602
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
(cherry picked from commit ef8204d64f44c4643482c7e6a01313a1b702ca43)
Reviewed-on: https://review.typo3.org/22608
[BUGFIX] Failures in em unit tests due to phpunit update

Young phpunit versions seem to handle clones a bit differently,
resulting in test failures in extension manager tests. The tests
are adapted a bit to fix this.

Change-Id: If70561743f68a62167e41ee4c23ae96b56f83ab9
Resolves: #50478
Releases: 6.2, 6.1, 6.0
Reviewed-on: https://review.typo3.org/22604
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
(cherry picked from commit eab10d590ceacc7d256a8ea195a2e562099fb52d)
Reviewed-on: https://review.typo3.org/22610
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn