createMock(ScopeConfigInterface::class); $scopeConfig->method('getValue')->willReturnCallback( static function (string $path, string $scope = 'default', $scopeCode = null): string { if ($path !== 'esun_lingxing/general/store_mapping' || $scope !== ScopeInterface::SCOPE_WEBSITE) { return ''; } return (int)$scopeCode === 1 ? '10009|STORE-US' : '10002|STORE-EU'; } ); $config = new Config($scopeConfig, $this->createMock(EncryptorInterface::class)); self::assertSame(10009, $config->getPlatformCode(1)); self::assertSame('STORE-US', $config->getLingxingStoreId(1)); self::assertSame(10002, $config->getPlatformCode(2)); self::assertSame('STORE-EU', $config->getLingxingStoreId(2)); } public function testSkuSyncPageSizeIsBounded(): void { $scopeConfig = $this->createMock(ScopeConfigInterface::class); $scopeConfig->method('getValue')->with('esun_lingxing/sku_sync/page_size')->willReturn('500'); $config = new Config($scopeConfig, $this->createMock(EncryptorInterface::class)); self::assertSame(200, $config->getSkuSyncPageSize()); } }