Example #1
0
 /**
  * Imports data from the current request into an record
  *
  * @param mixed $source
  * @param \PSX\Data\TransformerInterface $transformer
  * @param string $readerType
  * @return \PSX\Data\RecordInterface
  */
 protected function import($source, TransformerInterface $transformer = null, $readerType = null)
 {
     return $this->importer->import($source, $this->request, $transformer, $readerType);
 }
Example #2
0
 /**
  * @expectedException \RuntimeException
  */
 public function testImportEmptyBody()
 {
     $message = new Message();
     $message->addHeader('Content-Type', 'application/json');
     $message->setBody(new StringStream(''));
     $importer = new Importer(Environment::getService('extractor'), Environment::getService('importer_manager'));
     $importer->import(new Page(), $message);
 }