Issue Bug Closed

#23262unittest in tests/t3lib/cache/backend/t3lib_cache_backend_filebackendTest.php fails if installed in subdir of document_root

Philipp Gampe 07/24/10, 20:05 updated 10/02/18, 12:24

Description

The unittest fail, because t3lib_div::getIndpEnv(‘TYPO3_DOCUMENT_ROOT’) does not return right path.

Solution, use PATH_site instead.

Install TYPO3 inside a subdir
Run unittest “tests/t3lib/cache/backend/t3lib_cache_backend_filebackendTest.php“
See two errors

Apply path and see errors go away

This is the exact failure:

Get cache directory returns the current cache directory
! Failure in test case getCacheDirectoryReturnsTheCurrentCacheDirectory
File: /home/spieler/t3_playground/t3_trunk/tests/t3lib/cache/backend/t3lib_cache_backend_filebackendTest.php
Line: 118:
Description
getCacheDirectory() did not return the expected value. Failed asserting that <string:/opt/lampp/htdocs/t3_playground/dummy/typo3temp/cache/testing/> is equal to <string:/opt/lampp/htdocs/typo3temp/cache/testing/>.
Memory leak: 34 KB Time: 0.0142 sec.
Get returns false for expired entries
! Failure in test case getReturnsFalseForExpiredEntries
File: /home/spieler/svn/phpunit/PHPUnit-3.4.12/PHPUnit/Framework/MockObject/InvocationMocker.php
Line: 151:
Description
Expectation failed for method name is equal to <string:isCacheFileExpired> when invoked 1 time(s) Parameter 0 for invocation t3lib_cache_backend_FileBackend::isCacheFileExpired(<string:/opt/la…edEntry>) does not match expected value. Failed asserting that <string:/opt/lampp/htdocs/t3_playground/dummy/typo3temp/cache/UnitTestCache/ExpiredEntry> is equal to <string:/opt/lampp/htdocs/typo3temp/cache/UnitTestCache/ExpiredEntry>.
Memory leak: 60 KB Time: 0.0261 sec.
(issue imported from #M15224)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.