-
-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Normalizes the download method is the package
- Loading branch information
Showing
8 changed files
with
117 additions
and
32 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
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
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
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 |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
|
||
namespace League\Csv; | ||
|
||
use InvalidArgumentException; | ||
use PHPUnit\Framework\Attributes\DataProvider; | ||
use PHPUnit\Framework\Attributes\Group; | ||
use PHPUnit\Framework\TestCase; | ||
|
@@ -110,16 +111,16 @@ public function testCloningIsForbidden(): void | |
public function testOutputSize(): void | ||
{ | ||
ob_start(); | ||
$length = $this->csv->output('test.csv'); | ||
$length = $this->csv->download('test.csv'); | ||
ob_end_clean(); | ||
self::assertSame(60, $length); | ||
} | ||
|
||
public function testInvalidOutputFile(): void | ||
{ | ||
$this->expectException(InvalidArgument::class); | ||
$this->expectException(InvalidArgumentException::class); | ||
|
||
$this->csv->output('invalid/file.csv'); | ||
$this->csv->download('invalid/file.csv'); | ||
} | ||
|
||
public function testOutputHeaders(): void | ||
|
@@ -131,7 +132,7 @@ public function testOutputHeaders(): void | |
$raw_csv = Bom::Utf8->value."john,doe,[email protected]\njane,doe,[email protected]\n"; | ||
$csv = Reader::createFromString($raw_csv); | ||
ob_start(); | ||
$csv->output('tést.csv'); | ||
$csv->download('tést.csv'); | ||
ob_end_clean(); | ||
$headers = xdebug_get_headers(); | ||
|
||
|
@@ -457,7 +458,7 @@ public function testOutputStripBOM(): void | |
$csv->setOutputBOM(Bom::Utf16Be->value); | ||
|
||
ob_start(); | ||
$csv->output(); | ||
$csv->download(); | ||
/** @var string $result */ | ||
$result = ob_get_clean(); | ||
|
||
|
@@ -473,7 +474,7 @@ public function testOutputDoesNotStripBOM(): void | |
$csv->includeInputBOM(); | ||
|
||
ob_start(); | ||
$csv->output(); | ||
$csv->download(); | ||
/** @var string $result */ | ||
$result = ob_get_clean(); | ||
|
||
|
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