Permalink
Browse files

MINOR Specifically turning off Transliterator in FileNameFilterTest, …

…was assumed to be on regardless of setting (surfaced by d1ebe1c)
  • Loading branch information...
1 parent 4a2fe98 commit ea7310c36a7ff543860d72ee84dfa5fa0a8da79b @chillu chillu committed Nov 14, 2011
Showing with 6 additions and 3 deletions.
  1. +6 −3 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,26 +18,28 @@ 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)
);
}
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)
);
}
function testFilterWithEmptyString() {
$name = 'ö ö ö.jpg';
$filter = new FileNameFilter();
+ $filter->setTransliterator(new Transliterator());
$result = $filter->filter($name);
$this->assertFalse(
empty($result)

0 comments on commit ea7310c

Please sign in to comment.