| 1 | <?php |
||
| 7 | class MassImportTest extends ConnectTestHelper |
||
| 8 | { |
||
| 9 | public function testHandleProductUpdates() |
||
| 10 | { |
||
| 11 | // pseudo verify SDK |
||
| 12 | $conn = Shopware()->Db(); |
||
| 13 | $conn->delete('sw_connect_shop_config', array()); |
||
| 14 | $conn->insert('sw_connect_shop_config', array('s_shop' => '_self_', 's_config' => -1)); |
||
| 15 | $conn->insert('sw_connect_shop_config', array('s_shop' => '_last_update_', 's_config' => time())); |
||
| 16 | $conn->insert('sw_connect_shop_config', array('s_shop' => '_categories_', 's_config' => serialize(array('/bücher' => 'Bücher')))); |
||
| 17 | } |
||
| 18 | |||
| 19 | |||
| 20 | public function _testMassImportProducts() |
||
| 21 | { |
||
| 22 | $commands = array(); |
||
| 23 | for ($i=0; $i<=60; $i++) { |
||
| 24 | $product = $this->getProduct(); |
||
| 25 | $commands[$product->sourceId] = new \Shopware\Connect\Struct\Change\ToShop\InsertOrUpdate(array( |
||
| 26 | 'product' => $product, |
||
| 27 | 'revision' => time(), |
||
| 28 | )); |
||
| 29 | } |
||
| 30 | |||
| 31 | $start = microtime(true); |
||
| 32 | $this->dispatchRpcCall('products', 'toShop', array( |
||
| 33 | $commands |
||
| 34 | )); |
||
| 35 | |||
| 36 | $end = microtime(true); |
||
| 37 | |||
| 38 | $t = $end - $start; |
||
| 39 | |||
| 40 | echo $t; |
||
| 41 | |||
| 42 | } |
||
| 43 | |||
| 44 | } |
||
| 45 |