Skip to content

Commit

Permalink
fix tests (#3737)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitek-rostislav authored Jan 15, 2025
2 parents 4c72919 + e4cc2fe commit 981b7ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ public function testAreProductsVisibleForDefaultPricingGroupOnEachDomainIndexedB
$visibilityIndexedByProductId = $this->productVisibilityFacade->areProductsVisibleForDefaultPricingGroupOnSomeDomainIndexedByProductId(
[$productId],
);
$this->assertTrue($visibilityIndexedByProductId[$productId]);
$this->assertSame($visibilityIndexedByProductId[$productId], $this->domain->isMultidomain());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -227,19 +227,19 @@ public function testChangePersonalDataWithWrongData(): void

$firstDomainLocale = $this->getLocaleForFirstDomain();
$expectedViolationMessages = [
0 => t(
'input.firstName' => t(
'First name cannot be longer than {{ limit }} characters',
['{{ limit }}' => 100],
'validators',
$firstDomainLocale,
),
1 => t(
'input.lastName' => t(
'Last name cannot be longer than {{ limit }} characters',
['{{ limit }}' => 100],
'validators',
$firstDomainLocale,
),
2 => t(
'input.telephone' => t(
'Telephone number cannot be longer than {{ limit }} characters',
['{{ limit }}' => 30],
'validators',
Expand All @@ -250,13 +250,12 @@ public function testChangePersonalDataWithWrongData(): void
$this->assertResponseContainsArrayOfExtensionValidationErrors($response);
$responseData = $this->getErrorsExtensionValidationFromResponse($response);

$i = 0;
$this->assertCount(count($expectedViolationMessages), $responseData);

foreach ($responseData as $responseRow) {
foreach ($responseData as $key => $responseRow) {
foreach ($responseRow as $validationError) {
$this->assertArrayHasKey('message', $validationError);
$this->assertEquals($expectedViolationMessages[$i], $validationError['message']);
$i++;
$this->assertEquals($expectedViolationMessages[$key], $validationError['message']);
}
}
}
Expand Down

0 comments on commit 981b7ae

Please sign in to comment.