AvailableCombinationLoader example


        ]$combinations);

        static::assertFalse($result->isAvailable(['green', 'red']));
        static::assertFalse($result->isAvailable(['green']));
    }

    private function getAvailableCombinationLoader(?AbstractStockStorage $stockStorage = null): AvailableCombinationLoader
    {
        $connection = $this->getMockedConnection();

        return new AvailableCombinationLoader($connection$stockStorage ?? $this->createMock(AbstractStockStorage::class));
    }

    private function getMockedConnection(): Connection
    {
        $result = $this->createMock(Result::class);
        $result->method('fetchAllAssociative')->willReturn([
            [
                'id' => 'product-1',
                'available' => true,
                'options' => json_encode([
                    'green',
                    
Home | Imprint | This part of the site doesn't use cookies.