示例#1
0
 public function testBatch()
 {
     $translations = array();
     for ($i = 0; $i < 4; $i++) {
         $translations[] = $this->getDummyData('article');
     }
     $article = Shopware()->Db()->fetchRow("SELECT ordernumber, articleID\n            FROM s_articles_details\n            LIMIT 1");
     $translations[0]['key'] = $article['ordernumber'];
     $translations[0]['useNumberAsId'] = true;
     $results = $this->resource->batch($translations);
     foreach ($results as $result) {
         $this->assertTrue($result['success']);
         $this->assertEquals('update', $result['operation']);
         $this->assertNotEmpty($result['data']);
         $this->assertEquals(2, $result['data']['shopId']);
     }
 }