Skip to content

Commit 3262dbd

Browse files
committed
Merge branch '5.x' into feature/variant-mgmt-improvements
2 parents 342865c + f1ea5b6 commit 3262dbd

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

tests/fixtures/data/stores.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
return [
44
'primary' => [
55
'_load' => false,
6-
'_sites' => [1000],
6+
'_sites' => [1, 1000],
77
'settings' => [
88
'_storeLocationAddress' => [
99
'countryCode' => 'US',

tests/unit/elements/variant/VariantQueryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public function queryingBySiteDataProvider(): array
242242
{
243243
return [
244244
'one-site' => [['testSite1'], 3, ['testSite1' => 'primary']],
245-
'two-sites-same-store' => [['testSite1', 'default'], 6, ['testSite1' => 'primary', 'default' => 'primary']],
245+
'two-sites-same-store' => [['testSite1', 'defaultSite'], 6, ['testSite1' => 'primary', 'defaultSite' => 'primary']],
246246
'two-sites-different-stores' => [['testSite1', 'testSite2'], 6, ['testSite1' => 'primary', 'testSite2' => 'euStore']],
247247
];
248248
}

tests/unit/services/CatalogPricingTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,15 @@ public function testGeneratePricesNoRules(): void
7979
self::assertCount(10, (new Query())->select('id')->from(Table::CATALOG_PRICING)->all());
8080

8181
$checkVariantPrices = function(Product $product) {
82-
$product->getVariants()->each(function(Variant $variant) use ($product) {
83-
self::assertEquals($variant->basePrice, (new Query())
82+
$storeId = $product->getStore()->id;
83+
$product->getVariants()->each(function(Variant $variant) use ($storeId) {
84+
$price = (new Query())
8485
->select('price')
8586
->from(Table::CATALOG_PRICING)
8687
->where(['purchasableId' => $variant->id])
87-
->andWhere(['storeId' => $product->storeId])
88-
->scalar(),
88+
->andWhere(['storeId' => $storeId])
89+
->scalar();
90+
self::assertEquals($variant->basePrice, $price,
8991
$variant->title . ' price has been generated correctly'
9092
);
9193
});

0 commit comments

Comments
 (0)