$this->
stopTransactionAfter();
$commandTester =
new CommandTester($this->importEntityCommand
);
$args =
[ 'file' => self::TEST_INVALID_IMPORT_FILE_PATH,
'expireDate' =>
date('d.m.Y'
),
'profile' => self::DEFAULT_PRODUCT_IMPORT_PROFILE,
'-r' => true,
'-p' => true,
];
$commandTester->
execute($args);
$this->
startTransactionBefore();
$message =
$commandTester->
getDisplay();
static::
assertStringContainsString(sprintf('[ERROR] Errors on import. Rolling back transactions for %d records.',
$num),
$message);
static::
assertStringContainsString('Integrity constraint violation',
$message);
$repository =
$this->
getContainer()->
get('product.repository'
);
$result =
$repository->
searchIds(new Criteria(), Context::
createDefaultContext());
static::
assertCount(0,
$result->
getIds());
}}