[TASK] Tests: Isolate GeneralUtility tests from real filesystem 00/44300/6
authorMorton Jonuschat <m.jonuschat@mojocode.de>
Mon, 26 Oct 2015 18:15:53 +0000 (19:15 +0100)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Fri, 30 Oct 2015 08:55:15 +0000 (09:55 +0100)
commitd49f117b08d703bffbb901a197020277c250ac92
tree36da5738a9f00951fa041c510f5fcd88b143aa60
parent54c98ec32133bcc3de3eb90a30029959fb52aea5
[TASK] Tests: Isolate GeneralUtility tests from real filesystem

Use the vfsStream wrapper to provide a virtual filesystem on which to
run the unit tests. This allows isolationg the tests for filesystem
operations from the actual implementation of the filesystem and the
capabilities of the user running the test suite.

The group ownership tests were converted to work with numeric group ids
as PHP on OS X has problems changing the group of a file if the group
name contains a dot. This also fixes the selection of the secondary
group on OS X as the static group offset used in the test didn't ensure
that the returned group was different from the effective group at the
time.

Tests using symlinks could not be modified to use vfsStream as the
symlink method only works with real filesystems.

The GeneralUtility test for relative paths could not be changed either
as vfs paths are always "absolute".

Resolves: #71052
Releases: master
Change-Id: I81c3f1de4b09b971a7e7ab4b09672e4d34934995
Reviewed-on: https://review.typo3.org/44300
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/core/Tests/Unit/Utility/Fixtures/GeneralUtilityFilesystemFixture.php [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php