silverstripe / silverstripe-assets

Silverstripe Assets component
BSD 3-Clause "New" or "Revised" License
9 stars 65 forks source link

fallback to default on basename equals ext #495

Closed PawelSuwinski closed 2 years ago

PawelSuwinski commented 2 years ago

Fixes silverstripe/silverstripe-assets#494

PawelSuwinski commented 2 years ago

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 commented 2 years ago

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

PawelSuwinski commented 2 years ago

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

Fixed