Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unit tests to enable to run CacheResourceFileTest.php on Windows #1055

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

matsuo
Copy link
Contributor

@matsuo matsuo commented Aug 17, 2024

This PR fixes unit tests to enable to run CacheResourceFileTest.php on Windows. (Related PR: #1046 )
Some unit tests in CacheResourceFileTest.php now take the directory separator of Windows into account.

Test Results after modification:

> php .\vendor\phpunit\phpunit\phpunit --filter=CacheResourceFileTest
PHPUnit 8.5.39 by Sebastian Bergmann and contributors.

...............................................................   63 / 63 (100%)

Time: 56.96 seconds, Memory: 18.00 MB

OK (63 tests, 258 assertions)

Current Test Results:
(from #1046 (comment) )

1) CacheResourceFileTest::testGetCachedFilepathSubDirs
Failed asserting that 'D:\a\smarty\smarty\tests\UnitTests\CacheResourceTests\File\cache\ca\25\46\ca2546820bc1a72783da84062884d71d8e3c1ff4_helloworld.tpl.php' matches PCRE pattern "/.*\/([a-f0-9]{2}\/){3}.*.php/".

D:\a\smarty\smarty\tests\UnitTests\CacheResourceTests\File\CacheResourceFileTest.php:41

2) CacheResourceFileTest::testGetCachedFilepathCacheId
Failed asserting that 'D:\a\smarty\smarty\tests\UnitTests\CacheResourceTests\File\cache\foo\bar\ca\25\46\ca2546820bc1a72783da84062884d71d8e3c1ff4_helloworld.tpl.php' matches PCRE pattern "/.*\/foo\/bar\/([a-f0-9]{2}\/){3}.*.php/".

D:\a\smarty\smarty\tests\UnitTests\CacheResourceTests\File\CacheResourceFileTest.php:54

3) CacheResourceFileTest::testGetCachedFilepathCompileId
Failed asserting that 'D:\a\smarty\smarty\tests\UnitTests\CacheResourceTests\File\cache\blar\ca\25\46\ca2546820bc1a72783da84062884d71d8e3c1ff4_helloworld.tpl.php' matches PCRE pattern "/.*\/blar\/([a-f0-9]{2}\/){3}.*.php/".

D:\a\smarty\smarty\tests\UnitTests\CacheResourceTests\File\CacheResourceFileTest.php:66

4) CacheResourceFileTest::testGetCachedFilepathCacheIdCompileId
Failed asserting that 'D:\a\smarty\smarty\tests\UnitTests\CacheResourceTests\File\cache\foo\bar\blar\ca\25\46\ca2546820bc1a72783da84062884d71d8e3c1ff4_helloworld.tpl.php' matches PCRE pattern "/.*\/foo\/bar\/blar\/([a-f0-9]{2}\/){3}.*.php/".

D:\a\smarty\smarty\tests\UnitTests\CacheResourceTests\File\CacheResourceFileTest.php:78

@wisskid wisskid merged commit 2f781e2 into smarty-php:master Aug 28, 2024
11 checks passed
@matsuo matsuo deleted the modify-cache-resource-file-test branch August 28, 2024 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants