-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename file w/ non-ascii characters, add test #88
- Loading branch information
Showing
4 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
namespace ZBateson\MailMimeParser; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use FilesystemIterator; | ||
use RecursiveDirectoryIterator; | ||
use RecursiveIteratorIterator; | ||
|
||
/** | ||
* Some 'unzip' utilities don't like non-ASCII characters appearing in file | ||
* names. Created this test to prevent it from happening as it's happened more | ||
* than once. | ||
* | ||
* @group Base | ||
* @author Zaahid Bateson | ||
*/ | ||
class OnlyAsciiFileNamesTest extends TestCase | ||
{ | ||
public function testFileNames() | ||
{ | ||
$dir = new RecursiveDirectoryIterator(dirname(__DIR__), FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::SKIP_DOTS); | ||
$iter = new RecursiveIteratorIterator($dir); | ||
foreach ($iter as $f) { | ||
$this->assertTrue( | ||
mb_check_encoding($f->getFileName(), 'ASCII'), | ||
$f->getFileName() . ' contains non-ascii characters, which may ' | ||
. 'cause problems with some \'unzip\' utilities when ' | ||
. 'installing via composer' | ||
); | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters