在 UnitTest Shopware 中编辑插件配置
Edit plugin config in UnitTest Shopware
我想测试使用插件配置的插件的功能。
是否可以在 UnitTest 中编辑插件的配置?
寻找现有测试作为示例总是一个好主意。
例如全文搜索“Config”
vendor/shopware/storefront/Test
.
这导致
vendor/shopware/storefront/Test/Page/ProductPageTest.php:93
例如:
// enable hideCloseoutProductsWhenOutOfStock filter
$this->getContainer()->get(SystemConfigService::class)
->set('core.listing.hideCloseoutProductsWhenOutOfStock', true);
我想测试使用插件配置的插件的功能。
是否可以在 UnitTest 中编辑插件的配置?
寻找现有测试作为示例总是一个好主意。
例如全文搜索“Config”
vendor/shopware/storefront/Test
.
这导致
vendor/shopware/storefront/Test/Page/ProductPageTest.php:93
例如:
// enable hideCloseoutProductsWhenOutOfStock filter
$this->getContainer()->get(SystemConfigService::class)
->set('core.listing.hideCloseoutProductsWhenOutOfStock', true);