6 declare(strict_types=1);
12 use PHPUnit\Framework\TestCase;
19 private $massAssignValidator;
32 $skus = [
'SKU-1',
'SKU-2'];
33 $sources = [
'non-existing-source1',
'non-existing-source2'];
35 $validationResult = $this->massAssignValidator->validate(
$skus, $sources);
38 $validationResult->isValid(),
39 'Validation did not detect invalid source codes' 42 $errors = $validationResult->getErrors();
43 self::assertCount(2,
$errors,
'Validation did not find all invalid source codes');
46 'Source %sourceCode does not exist',
48 'Unexpected error message from validator' 51 'Source %sourceCode does not exist',
53 'Unexpected error message from validator'
foreach($websiteCodes as $websiteCode) $skus
static getObjectManager()