Révision ecd39969
Ajouté par Assos Assos il y a environ 5 ans
drupal7/modules/simpletest/tests/file.test | ||
---|---|---|
957 | 957 |
$path = file_create_filename($basename, $directory); |
958 | 958 |
$this->assertEqual($path, $expected, format_string('Creating a new filepath from %original equals %new.', array('%new' => $path, '%original' => $original)), 'File'); |
959 | 959 |
|
960 |
try { |
|
961 |
$filename = "a\xFFtest\x80€.txt"; |
|
962 |
file_create_filename($filename, $directory); |
|
963 |
$this->fail('Expected exception not thrown'); |
|
964 |
} |
|
965 |
catch (RuntimeException $e) { |
|
966 |
$this->assertEqual("Invalid filename '$filename'", $e->getMessage()); |
|
967 |
} |
|
968 |
|
|
960 | 969 |
// @TODO: Finally we copy a file into a directory several times, to ensure a properly iterating filename suffix. |
961 | 970 |
} |
962 | 971 |
|
... | ... | |
989 | 998 |
$this->assertNotEqual($path, $destination, 'A new filepath destination is created when filepath destination already exists with FILE_EXISTS_RENAME.', 'File'); |
990 | 999 |
$path = file_destination($destination, FILE_EXISTS_ERROR); |
991 | 1000 |
$this->assertEqual($path, FALSE, 'An error is returned when filepath destination already exists with FILE_EXISTS_ERROR.', 'File'); |
1001 |
|
|
1002 |
try { |
|
1003 |
file_destination("core/misc/a\xFFtest\x80€.txt", FILE_EXISTS_REPLACE); |
|
1004 |
$this->fail('Expected exception not thrown'); |
|
1005 |
} |
|
1006 |
catch (RuntimeException $e) { |
|
1007 |
$this->assertEqual("Invalid filename 'a\xFFtest\x80€.txt'", $e->getMessage()); |
|
1008 |
} |
|
992 | 1009 |
} |
993 | 1010 |
|
994 | 1011 |
/** |
Formats disponibles : Unified diff
Udpate to 7.65