Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
ProductExporter example
$csvRows
=
explode
(
\PHP_EOL,
$fileContent
)
;
static
::
assertTrue
(
$this
->fileSystem->
directoryExists
(
$this
->
getContainer
(
)
->
getParameter
(
'product_export.directory'
)
)
)
;
static
::
assertTrue
(
$this
->fileSystem->
fileExists
(
$filePath
)
)
;
static
::
assertCount
(
4,
$csvRows
)
;
}
public
function
testExportPagination
(
)
: void
{
$this
->
createTestEntity
(
)
;
$service
=
new
ProductExporter
(
$this
->
getContainer
(
)
->
get
(
'product_export.repository'
)
,
$this
->
getContainer
(
)
->
get
(
ProductExportGenerator::
class
)
,
$this
->
getContainer
(
)
->
get
(
'event_dispatcher'
)
,
$this
->
getContainer
(
)
->
get
(
ProductExportFileHandler::
class
)
)
;
$service
->
export
(
$this
->salesChannelContext,
new
ExportBehavior
(
)
)
;
$filePath
=
sprintf
(
'%s/Testexport.csv',
$this
->
getContainer
(
)
->
getParameter
(
'product_export.directory'
)
)
;
static
::
assertTrue
(
$this
->fileSystem->
directoryExists
(
$this
->
getContainer
(
)
->
getParameter
(
'product_export.directory'
)
)
)
;