Bug #50844

Failing tests in TYPO3\CMS\Core\Tests\Unit\Resource\Driver\LocalDriverTest on Windows systems

Added by Nicole Cordes almost 7 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Tests
Target version:
Start date:
2013-08-06
Due date:
% Done:

100%

TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

There are multiple tests failing on Windows systems:

createdFilesAreEmpty
Error in test case createdFilesAreEmpty
File: C:\Users\Nicole\Version Control\Git\TYPO3\TYPO3.CMS\master\typo3\sysext\core\Classes\Resource\Driver\LocalDriver.php
Line: 1171
file_get_contents(C:/Users/Nicole/Server/typo3-master.local/typo3temp/fal-test-52015817c50c7/) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory

getFileListReturnsAllFilesInDirectory
Failure in test case getFileListReturnsAllFilesInDirectory
File: C:\Users\Nicole\Version Control\Git\TYPO3\TYPO3.CMS\master\typo3\sysext\core\Tests\Unit\Resource\Driver\LocalDriverTest.php
Line: 740
Failed asserting that two arrays are equal.
Array ( 0 =>'file1' 1 =>'file2' )

getFileListReturnsAllFilesInSubdirectoryIfRecursiveParameterIsSet
Failure in test case getFileListReturnsAllFilesInSubdirectoryIfRecursiveParameterIsSet
File: C:\Users\Nicole\Version Control\Git\TYPO3\TYPO3.CMS\master\typo3\sysext\core\Tests\Unit\Resource\Driver\LocalDriverTest.php
Line: 765
Failed asserting that two arrays are equal.
Array ( 0 =>'aDir/subdir/file4' 1 =>'aDir/file3' 2 =>'file1' 3 =>'file2' )

getFolderListReturnsAllDirectoriesInDirectory
Failure in test case getFolderListReturnsAllDirectoriesInDirectory
File: C:\Users\Nicole\Version Control\Git\TYPO3\TYPO3.CMS\master\typo3\sysext\core\Tests\Unit\Resource\Driver\LocalDriverTest.php
Line: 857
Failed asserting that two arrays are equal.
Array ( 0 =>'dir1' 1 =>'dir2' )

getFolderListReturnsHiddenFoldersByDefault
Failure in test case getFolderListReturnsHiddenFoldersByDefault
File: C:\Users\Nicole\Version Control\Git\TYPO3\TYPO3.CMS\master\typo3\sysext\core\Tests\Unit\Resource\Driver\LocalDriverTest.php
Line: 876
Failed asserting that two arrays are equal.
Array ( 0 =>'.someHiddenDir' 1 =>'aDir' )

getFolderListUsesCorrectPathForItems
Failure in test case getFolderListUsesCorrectPathForItems
File: C:\Users\Nicole\Version Control\Git\TYPO3\TYPO3.CMS\master\typo3\sysext\core\Tests\Unit\Resource\Driver\LocalDriverTest.php
Line: 892
Failed asserting that null matches expected '/dir1/'.

copyFolderWithinStorageCopiesSingleSubFolderToNewFolderName
! Error in test case copyFolderWithinStorageCopiesSingleSubFolderToNewFolderName
File: C:\Users\Nicole\Version Control\Composer\phpunit\vendor\mikey179\vfsStream\src\main\php\org\bovigo\vfs\vfsStreamWrapper.php
Line: 816
mkdir(): Path vfs://base-5201581c47251/targetFolder/newFolderName/subFolder exists

copyFolderWithinStorageCopiesFileInSingleSubFolderToNewFolderName
! Error in test case copyFolderWithinStorageCopiesFileInSingleSubFolderToNewFolderName
File: C:\Users\Nicole\Version Control\Composer\phpunit\vendor\mikey179\vfsStream\src\main\php\org\bovigo\vfs\vfsStreamWrapper.php
Line: 816
mkdir(): Path vfs://base-5201581c5bfd6/targetFolder/newFolderName/subFolder exists

Associated revisions

Revision bc330c1f (diff)
Added by Nicole Cordes almost 7 years ago

[BUGFIX] Failing tests in Resource\Driver\LocalDriverTest on Windows

The test createdFilesAreEmpty depends on another test which returns a
mocked object. In the mock two returnValues for getIdentifier() and
getName() were set. But due to PHPUnit architecture mocked functions
belong to the test there were defined and cannot be shared. This is why
the mock has to be initialized within the test itself. The test only
works because on unix system you can open a folder which returns an
empty string.

Furthermore if you use any php function to get a folder path we have to
fix the containing backslashes.

Finally due to some errors we have to rewind any iterator of class
RecursiveIteratorIterator as otherwise a wrong index is returned.

Resolves: #50844
Releases: 6.2, 6.1, 6.0
Change-Id: I13f9efbd1618056fcd66220e3de5e12af79e4dc6
Reviewed-on: https://review.typo3.org/22895
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision 4943a8f8 (diff)
Added by Nicole Cordes almost 7 years ago

[BUGFIX] Failing tests in Resource\Driver\LocalDriverTest on Windows

The test createdFilesAreEmpty depends on another test which returns a
mocked object. In the mock two returnValues for getIdentifier() and
getName() were set. But due to PHPUnit architecture mocked functions
belong to the test there were defined and cannot be shared. This is why
the mock has to be initialized within the test itself. The test only
works because on unix system you can open a folder which returns an
empty string.

Furthermore if you use any php function to get a folder path we have to
fix the containing backslashes.

Finally due to some errors we have to rewind any iterator of class
RecursiveIteratorIterator as otherwise a wrong index is returned.

Resolves: #50844
Releases: 6.2, 6.1, 6.0
Change-Id: I13f9efbd1618056fcd66220e3de5e12af79e4dc6
Reviewed-on: https://review.typo3.org/23040
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert

Revision 5b828c70 (diff)
Added by Nicole Cordes almost 7 years ago

[BUGFIX] Failing tests in Resource\Driver\LocalDriverTest on Windows

The test createdFilesAreEmpty depends on another test which returns a
mocked object. In the mock two returnValues for getIdentifier() and
getName() were set. But due to PHPUnit architecture mocked functions
belong to the test there were defined and cannot be shared. This is why
the mock has to be initialized within the test itself. The test only
works because on unix system you can open a folder which returns an
empty string.

Furthermore if you use any php function to get a folder path we have to
fix the containing backslashes.

Finally due to some errors we have to rewind any iterator of class
RecursiveIteratorIterator as otherwise a wrong index is returned.

Resolves: #50844
Releases: 6.2, 6.1, 6.0
Change-Id: I13f9efbd1618056fcd66220e3de5e12af79e4dc6
Reviewed-on: https://review.typo3.org/22904
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert

History

#1 Updated by Gerrit Code Review almost 7 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/22895

#2 Updated by Gerrit Code Review almost 7 years ago

Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/22904

#3 Updated by Nicole Cordes almost 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#4 Updated by Gerrit Code Review almost 7 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/23040

#5 Updated by Gerrit Code Review almost 7 years ago

Patch set 2 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/23040

#6 Updated by Nicole Cordes almost 7 years ago

  • Status changed from Under Review to Resolved

#7 Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF