-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for multiple limit import with heading row
- Loading branch information
Showing
1 changed file
with
36 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -105,7 +105,7 @@ public function limit(): int | |
$import->import('import-users.xlsx'); | ||
} | ||
|
||
public function test_can_import_with_heading_row() | ||
public function test_can_import_single_with_heading_row() | ||
{ | ||
$import = new class implements ToArray, WithLimit, WithHeadingRow | ||
{ | ||
|
@@ -136,6 +136,41 @@ public function limit(): int | |
$import->import('import-users-with-headings.xlsx'); | ||
} | ||
|
||
public function test_can_import_multiple_with_heading_row() | ||
{ | ||
$import = new class implements ToArray, WithLimit, WithHeadingRow | ||
{ | ||
use Importable; | ||
|
||
/** | ||
* @param array $array | ||
*/ | ||
public function array(array $array) | ||
{ | ||
Assert::assertEquals([ | ||
[ | ||
'Patrick Brouwers', | ||
'[email protected]', | ||
], | ||
[ | ||
'Taylor Otwell', | ||
'[email protected]', | ||
], | ||
], $array); | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function limit(): int | ||
{ | ||
return 2; | ||
} | ||
}; | ||
|
||
$import->import('import-users-with-headings.xlsx'); | ||
} | ||
|
||
public function test_can_set_limit_bigger_than_row_size() | ||
{ | ||
$import = new class implements ToArray, WithLimit | ||
|