|
@@ 107-115 (lines=9) @@
|
| 104 |
|
); |
| 105 |
|
} |
| 106 |
|
|
| 107 |
|
public function testSettingKeepOldToTrueFileWillKeepTheFile() |
| 108 |
|
{ |
| 109 |
|
$asciiFile = new LocalFile(static::$dir . 'ascii_keep.test'); |
| 110 |
|
$asciiFile->put(mb_convert_encoding('Some random Text', 'ASCII')); |
| 111 |
|
|
| 112 |
|
$this->converter->toEncoding($asciiFile, 'UTF-8', ['keepOldFile' => true]); |
| 113 |
|
|
| 114 |
|
static::assertTrue($asciiFile->exists(), "The original file should exist"); |
| 115 |
|
} |
| 116 |
|
|
| 117 |
|
public function testSettingKeepOldFileToFalseWillDeleteTheFile() |
| 118 |
|
{ |
|
@@ 117-125 (lines=9) @@
|
| 114 |
|
static::assertTrue($asciiFile->exists(), "The original file should exist"); |
| 115 |
|
} |
| 116 |
|
|
| 117 |
|
public function testSettingKeepOldFileToFalseWillDeleteTheFile() |
| 118 |
|
{ |
| 119 |
|
$asciiFile = new LocalFile(static::$dir . 'ascii_delete.test'); |
| 120 |
|
$asciiFile->put(mb_convert_encoding('Some random Text', 'ASCII')); |
| 121 |
|
|
| 122 |
|
$this->converter->toEncoding($asciiFile, 'UTF-8', ['keepOldFile' => false]); |
| 123 |
|
|
| 124 |
|
static::assertFalse($asciiFile->exists(), "The original file should be deleted"); |
| 125 |
|
} |
| 126 |
|
|
| 127 |
|
public function testConversionWillFailWhenSpecifyingAnInvalidEncoding() |
| 128 |
|
{ |