public function testValidateProductsDataFailMissingData() { $productData = $this->getExemplaryProductData(); $failCount = 0; foreach ($productData as $key => $value) { $missingProductData = array_diff_key($productData, [$key => $value]); $missingData = ['products' => [$missingProductData]]; if (!$this->model->validateProductsData($missingData)) { $failCount++; } } $this->assertEquals($failCount, count($productData)); }
/** * @inheritdoc */ public function validateCreate(array $data = []) { return $this->dataValidator->validateEmpty($data) && $this->dataValidator->validateBasicData($data) && $this->dataValidator->validateProductsData($data); }