示例#1
0
 public function testTransformationException()
 {
     $this->setExpectedException(ApiTransformationException::class);
     $transformer = new ItemTransformer();
     $rawItem = '{"name": "name1", "description": "description1", "price1":"222"}';
     $transformer->transform($rawItem, 1);
 }
示例#2
0
文件: Items.php 项目: holgergr/api
 /**
  * @param string $rawItem
  * @param null $id
  * @return Item
  */
 public function transformToEntity($rawItem, $id = null)
 {
     $transformer = new ItemTransformer();
     return $transformer->transform($rawItem, $id);
 }