public function testOverrideAdd() { $itemId = 1; $serviceInfo = ['rest' => ['resourcePath' => $this->_restResourcePath . $itemId, 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_PUT]]; $item = $this->itemFactory->create()->setName('test'); $requestData = ['entityItem' => $item->__toArray()]; $item = $this->_webApiCall($serviceInfo, $requestData); $this->assertEquals($itemId, $item[\Magento\TestModule5\Service\V1\Entity\AllSoapAndRest::ID], 'Identifier replacing failed.'); }
/** * {@inheritdoc} */ public function scalarUpdate($entityId, $name, $hasOrders) { return $this->factory->create()->setEntityId($entityId)->setName($name)->setHasOrders($hasOrders); }
/** * {@inheritdoc} */ public function create(\Magento\TestModule5\Service\V1\Entity\AllSoapAndRest $item) { return $this->factory->create()->setEntityId($item->getEntityId())->setName($item->getName())->setIsEnabled($item->isEnabled())->setHasOrders($item->hasOrders()); }