Skip to content

Commit

Permalink
Merge branch 'refs/heads/b-7.2.x' into b-8.0.x
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG-7.2.md
#	source/Application/Model/Article.php
#	source/Core/ViewConfig.php
#	tests/Codeception/Acceptance/ProductDetailsPageCest.php
AshrafOxid committed Apr 11, 2024

Unverified

This user has not yet uploaded their public signing key.
2 parents 8b52652 + 7b0e355 commit 7a828c2
Showing 7 changed files with 1 addition and 214 deletions.
1 change: 0 additions & 1 deletion source/Internal/Setup/Database/Sql/initial_data.sql
Original file line number Diff line number Diff line change
@@ -28,7 +28,6 @@ INSERT INTO `oxconfig` (`OXID`, `OXSHOPID`, `OXMODULE`, `OXVARNAME`, `OXVARTYPE`
('2a944b2cc31311e8957700163e4021bf', 1, '', 'includeProductReviewLinksInEmail', 'bool', ''),
('2ca4277aa49a5bd27.44511187', 1, '', 'blStockOnDefaultMessage', 'bool', '1'),
('2ca4277aa49a634f8.76432326', 1, '', 'blStockOffDefaultMessage', 'bool', '1'),
('0282a93ba014458d7a9249e5aef1a8eb', 1, '', 'blStockLowDefaultMessage', 'bool', '1'),
('2e4452b5763e03c74.88240349', 1, '', 'blDisableDublArtOnCopy', 'bool', '1'),
('32ddeaf2694e06b47b6ff74eafc69b65', 1, '', 'sParcelService', 'str', 'http://www.dpd.de/cgi-bin/delistrack?typ=1&lang=de&pknr=##ID##'),
('33341949f476b65e8.17282442', 1, '', 'iAttributesPercent', 'str', '70'),
1 change: 0 additions & 1 deletion source/Setup/Sql/initial_data.sql
Original file line number Diff line number Diff line change
@@ -28,7 +28,6 @@ INSERT INTO `oxconfig` (`OXID`, `OXSHOPID`, `OXMODULE`, `OXVARNAME`, `OXVARTYPE`
('2a944b2cc31311e8957700163e4021bf', 1, '', 'includeProductReviewLinksInEmail', 'bool', ''),
('2ca4277aa49a5bd27.44511187', 1, '', 'blStockOnDefaultMessage', 'bool', '1'),
('2ca4277aa49a634f8.76432326', 1, '', 'blStockOffDefaultMessage', 'bool', '1'),
('0282a93ba014458d7a9249e5aef1a8eb', 1, '', 'blStockLowDefaultMessage', 'bool', '1'),
('2e4452b5763e03c74.88240349', 1, '', 'blDisableDublArtOnCopy', 'bool', '1'),
('32ddeaf2694e06b47b6ff74eafc69b65', 1, '', 'sParcelService', 'str', 'http://www.dpd.de/cgi-bin/delistrack?typ=1&lang=de&pknr=##ID##'),
('33341949f476b65e8.17282442', 1, '', 'iAttributesPercent', 'str', '70'),
49 changes: 0 additions & 49 deletions source/migration/data/Version20231128113123.php

This file was deleted.

40 changes: 0 additions & 40 deletions tests/Codeception/Acceptance/Admin/MasterCoreStockSettingsCest.php

This file was deleted.

48 changes: 0 additions & 48 deletions tests/Codeception/Acceptance/Admin/ProductStockTestCest.php

This file was deleted.

2 changes: 1 addition & 1 deletion tests/Codeception/Support/Data/dump.sql
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ REPLACE INTO `oxarticles` (`OXID`, `OXSHOPID`, `OXPARENTID`, `OXACTIVE`, `OX
( '1002', 1, '', 1, '1002', '[DE 2] Test product 2 šÄßüл', 'Test product 2 short desc [DE]', 55, 0, 0, 0, 0, '', 0, NULL, 0, 0, 1, 'In stock [DE]', 'Out of stock [DE]', '0000-00-00', '2008-02-04', '2008-02-04 17:18:18', 0, 0, 0, 'search1002', 1, 'variants [DE]', 10, 2, '', 55, 67, 'variants [EN] šÄßüл', '', 'Test product 2 [EN] šÄßüл', 'Test product 2 short desc [EN] šÄßüл', 'šÄßüл1002', '', 'In stock [EN] šÄßüл', 'Out of stock [EN] šÄßüл', 0, 'testdistributor', 'testmanufacturer', 1, 1, 'MONTH'),
('1002-1', 1, '1002', 1, '1002-1', '', '', 55, 45, 0, 0, 0, '', 0, NULL, 0, 5, 1, 'In stock [DE]', 'Out of stock [DE]', '0000-00-00', '2008-02-04', '2008-02-04 17:34:10', 0, 0, 0, '', 1, '', 0, 0, 'var1 [DE]', 0, 0, '', 'var1 [EN] šÄßüл', '', '', '', '', 'In stock [EN] šÄßüл', 'Out of stock [EN] šÄßüл', 1, '', '', 0, 0, ''),
('1002-2', 1, '1002', 1, '1002-2', '', '', 67, 47, 0, 0, 0, '', 0, NULL, 0, 5, 1, 'In stock [DE]', 'Out of stock [DE]', '0000-00-00', '2008-02-04', '2008-02-04 17:34:36', 0, 0, 0, '', 1, '', 0, 0, 'var2 [DE]', 0, 0, '', 'var2 [EN] šÄßüл', '', '', '', '', 'In stock [EN] šÄßüл', 'Out of stock [EN] šÄßüл', 2, '', '', 0, 0, ''),
( '1001', 1, '', 1, '1001', '[DE 1] Test product 1 šÄßüл', 'Test product 1 short desc [DE]', 100, 0, 0, 0, 150, '', 0, 10, 0, 0, 1, '', '', '2030-01-01', '2008-02-04', '2008-02-04 17:35:49', 0, 0, 0, 'search1001', 1, '', 0, 0, '', 100, 0, '', '', 'Test product 1 [EN] šÄßüл', 'Test product 1 short desc [EN] šÄßüл', 'šÄßüл1001', '', '', '', 0, 'testdistributor', 'testmanufacturer', 0, 1, 'WEEK'),
( '1001', 1, '', 1, '1001', '[DE 1] Test product 1 šÄßüл', 'Test product 1 short desc [DE]', 100, 0, 0, 0, 150, '', 0, 10, 0, 0, 1, '', '', '2030-01-01', '2008-02-04', '2008-02-04 17:35:49', 0, 0, 0, 'search1001', 1, '', 0, 0, '', 100, 0, '', '', 'Test product 1 [EN] šÄßüл', 'Test product 1 short desc [EN] šÄßüл', 'šÄßüл1001', '', '', '', 0, 'testdistributor', 'testmanufacturer', 0, 1, 'WEEK'),
('10014', 1, '', 1, '10014', '13 DE product šÄßüл', '14 DE description', 1.6, 0, 0, 0, 0, '', 0, NULL, 0, 0, 1, '', '', '0000-00-00', '2008-04-03', '2008-04-03 12:50:20', 0, 0, 0, '', 1, 'size[DE] | color | type', 0, 12, '', 15, 25, 'size[EN] | color | type', '', '14 EN product šÄßüл', '13 EN description šÄßüл', '', '', '', '', 0, '', '', 0, 0, '');

#demodata for multidimensional variants
74 changes: 0 additions & 74 deletions tests/Integration/Application/Model/ArticleTest.php
Original file line number Diff line number Diff line change
@@ -176,78 +176,4 @@ public static function visibilityTimeRangesDataProvider(): array
'With invalid From/to' => [$future, $past, false],
];
}

public static function productLowStockDataProvider(): array
{
return [
'Product in low stock: Shop limit reached, Product limit undefined' => [5, 0.0, 10, false],
'Product in low stock: Shop limit exceeded, Product limit ignored' => [11, 20.0, 10, true],
'Product in low stock: Product limit reached' => [5, 10.0, 0, true]
];
}

#[DataProvider('productLowStockDataProvider')]
public function testProductLowStock(
int $productStock,
float $productLowStockLimit,
int $shopLowStockLimit,
bool $productLowStockActive
): void {
Registry::getConfig()->setConfigParam('blUseStock', true);
Registry::getConfig()->setConfigParam('sStockWarningLimit', $shopLowStockLimit);

$product = oxNew(Article::class);
$product->assign([
'oxarticles__oxstock' => $productStock,
'oxarticles__oxremindamount' => $productLowStockLimit,
'oxarticles__oxlowstockactive' => $productLowStockActive,
'oxarticles__oxparentid' => '',
'oxarticles__oxstockflag' => 1,
'oxarticles__oxshopid' => 1,
'oxarticles__oxvarstock' => $productStock,
'oxarticles__oxvarcount' => 0
]);

$this->assertEquals(1, $product->getStockStatus());
}

public function testProductInStock(): void
{
Registry::getConfig()->setConfigParam('blUseStock', true);
Registry::getConfig()->setConfigParam('sStockWarningLimit', 3);

$product = oxNew(Article::class);
$product->assign([
'oxarticles__oxstock' => 5,
'oxarticles__oxremindamount' => 0.0,
'oxarticles__oxlowstockactive' => false,
'oxarticles__oxparentid' => '',
'oxarticles__oxstockflag' => 1,
'oxarticles__oxshopid' => 1,
'oxarticles__oxvarstock' => 5,
'oxarticles__oxvarcount' => 0
]);

$this->assertEquals(0, $product->getStockStatus());
}

public function testProductOutStock(): void
{
Registry::getConfig()->setConfigParam('blUseStock', true);
Registry::getConfig()->setConfigParam('sStockWarningLimit', 0);

$product = oxNew(Article::class);
$product->assign([
'oxarticles__oxstock' => -1,
'oxarticles__oxremindamount' => 0.0,
'oxarticles__oxlowstockactive' => false,
'oxarticles__oxparentid' => '',
'oxarticles__oxstockflag' => 1,
'oxarticles__oxshopid' => 1,
'oxarticles__oxvarstock' => -1,
'oxarticles__oxvarcount' => 0
]);

$this->assertEquals(-1, $product->getStockStatus());
}
}

0 comments on commit 7a828c2

Please sign in to comment.