Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MINOR Specifically turning off Transliterator in FileNameFilterTest, …

…was assumed to be on regardless of setting (surfaced by d1ebe1c)
  • Loading branch information...
commit ea7310c36a7ff543860d72ee84dfa5fa0a8da79b 1 parent 4a2fe98
@chillu chillu authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 tests/filesystem/FileNameFilterTest.php
View
9 tests/filesystem/FileNameFilterTest.php
@@ -8,6 +8,7 @@ class FileNameFilterTest extends SapphireTest {
function testFilter() {
$name = 'Brötchen für allë-mit_Unterstrich!.jpg';
$filter = new FileNameFilter();
+ $filter->setTransliterator(false);
$this->assertEquals(
'Brtchen-fr-all-mit-Unterstrich.jpg',
$filter->filter($name)
@@ -17,7 +18,7 @@ function testFilter() {
function testFilterWithTransliterator() {
$name = 'Brötchen für allë-mit_Unterstrich!.jpg';
$filter = new FileNameFilter();
- $filter->setTransliterator(Object::create('Transliterator'));
+ $filter->setTransliterator(new Transliterator());
$this->assertEquals(
'Broetchen-fuer-alle-mit-Unterstrich.jpg',
$filter->filter($name)
@@ -25,11 +26,12 @@ function testFilterWithTransliterator() {
}
function testFilterWithCustomRules() {
- $name = 'Brötchen für allë-mit_Unterstrich!.jpg';
+ $name = 'Kuchen ist besser.jpg';
$filter = new FileNameFilter();
+ $filter->setTransliterator(false);
$filter->setReplacements(array('/[\s-]/' => '_'));
$this->assertEquals(
- 'Brötchen__für_allë_mit_Unterstrich!.jpg',
+ 'Kuchen_ist_besser.jpg',
$filter->filter($name)
);
}
@@ -37,6 +39,7 @@ function testFilterWithCustomRules() {
function testFilterWithEmptyString() {
$name = 'ö ö ö.jpg';
$filter = new FileNameFilter();
+ $filter->setTransliterator(new Transliterator());
$result = $filter->filter($name);
$this->assertFalse(
empty($result)
Please sign in to comment.
Something went wrong with that request. Please try again.