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

fallback to default on basename equals ext #495

Merged

Conversation

PawelSuwinski
Copy link
Contributor

Fixes #494

Copy link
Contributor

@dhensby dhensby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. I think we'd need a test for this to illustrate what it is fixing and to make sure there aren't any future regressions.

Can you also squash the 3 commits so the contributions are atomic, please.

@PawelSuwinski PawelSuwinski force-pushed the #494-fallback_to_default_on_empty branch from 2c2d18d to 68e14b7 Compare May 25, 2022 10:36
@PawelSuwinski
Copy link
Contributor Author

PawelSuwinski commented May 25, 2022

Done.

Test case before fix:

# vendor/bin/phpunit vendor/silverstripe/assets/tests/php/FileNameFilterTest.php --filter Empty
(...)
There was 1 failure:

1) SilverStripe\Assets\Tests\FileNameFilterTest::testFilterWithEmptyString with data set #1 ('新しいファイル.jpg')
Failed asserting that 'jpg' ends with ".jpg".

/var/www/portal-app/portal/vendor/silverstripe/assets/tests/php/FileNameFilterTest.php:74
/var/www/portal-app/portal/vendor/sminnee/phpunit/phpunit:51
FAILURES!
Tests: 2, Assertions: 5, Failures: 1.

After fix:

# vendor/bin/phpunit vendor/silverstripe/assets/tests/php/FileNameFilterTest.php --filter Empty
(...)
OK (2 tests, 6 assertions)

@dhensby
Copy link
Contributor

dhensby commented May 25, 2022

There are some linting errors which need to be fixed :)

@PawelSuwinski PawelSuwinski force-pushed the #494-fallback_to_default_on_empty branch from 68e14b7 to 9c1427c Compare May 25, 2022 13:21
@PawelSuwinski
Copy link
Contributor Author

There are some linting errors which need to be fixed :)

Fixed

@GuySartorelli GuySartorelli merged commit a261358 into silverstripe:1 May 30, 2022
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.

FileNameFilter: no fallback to default name when post filtering basename is empty
3 participants