public function testTransformationException() { $this->setExpectedException(ApiTransformationException::class); $transformer = new ItemTransformer(); $rawItem = '{"name": "name1", "description": "description1", "price1":"222"}'; $transformer->transform($rawItem, 1); }
/** * @param string $rawItem * @param null $id * @return Item */ public function transformToEntity($rawItem, $id = null) { $transformer = new ItemTransformer(); return $transformer->transform($rawItem, $id); }