public function testPutFile()
 {
     $this->assertFileNotExists($this->path);
     $this->store->putFile($this->name, 'this is a test');
     $this->assertFileExists($this->path);
     $this->assertEquals('this is a test', file_get_contents($this->path));
 }
Example #2
0
 /**
  * @param Collection $collection
  */
 public function updateProducts(Collection $collection)
 {
     try {
         $remoteFileName = $this->buildRemoteFileName("SingleFeed-%s.xml");
         $xmlHandler = $this->requestHandlerFactory->create('product');
         $xmlElement = $xmlHandler->buildElement($collection);
         $contents = $xmlElement->asXML();
         $this->fileStore->putFile($remoteFileName, $contents);
     } catch (\Exception $e) {
         throw new CollectionException($e->getMessage());
     }
 }