get(\KupShop\CatalogBundle\Util\SetsUpdateStore::class); $setsUpdateStore->updateSetsStore($productId); $query = sqlQuery('SELECT id, in_store FROM products WHERE id IN (?) ORDER BY id', [array_keys($expectedSetsInStore)], [\Doctrine\DBAL\Connection::PARAM_INT_ARRAY]); $result = $query->fetchAll(PDO::FETCH_KEY_PAIR); $this->assertEquals($expectedSetsInStore, $result); } public function dataSet_testUpdateSetsStore() { return [ 'only set with product 1 updates' => [1, [ '3' => '1', '6' => '6', ]], 'only set with product 4 updates' => [4, [ '3' => '0', '6' => '0', ]], 'all sets update' => [null, [ '3' => '1', '6' => '0', ]], ]; } public function testOrderingSetProduct() { $dbcfg = Settings::getDefault(); $dbcfg->saveValue('order_availability', \Settings::ORDER_AVAILABILITY_IN_STORE_OR_SUPPLIER_STORE); $dbcfg->clearCache(true); $this->createCart(); $this->insertProduct(1, null, 3); $this->setInvoice(); $this->setDeliveryType(); $this->cart->createFromDB(); $this->expectException(CartValidationException::class); $this->expectExceptionMessage('Produkt \'NIKE Capri LACE Test Dlouheho Nazvu Produktu Test Dlouheho Produktu Tes\' není v požadovaném množství skladem.'); $this->cart->submitOrder(); } public function getDataSet() { return $this->getJsonDataSetFromFile(); } }