Skip to content

Commit 34a4237

Browse files
committed
Fix deprecation notice for str_getcsv() escape param.
1 parent aa49e37 commit 34a4237

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/phpunit/Unit/Admin/Export/Service/ProductExportServiceTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,12 @@ public function test_handle_batch_first_batch_sets_file_path_and_schedules_next(
150150

151151
$this->assertFileExists( $file_path );
152152

153-
$csv = array_map( 'str_getcsv', file( $file_path ) );
153+
$csv = array_map(
154+
static function( $line ) {
155+
return str_getcsv( $line, ',', '"', '\\' );
156+
},
157+
file( $file_path )
158+
);
154159

155160
$this->assertEquals(
156161
array( 'id', 'title', 'description', 'link', 'image_link', 'price', 'sale_price', 'gtin', 'availability' ),

0 commit comments

Comments
 (0)