ResourceFake.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. /**
  3. * Refer to LICENSE.txt distributed with the Temando Shipping module for notice of license
  4. */
  5. namespace Temando\Shipping\Test\Connection\Db;
  6. use Magento\Framework\Model\ResourceModel\Db\AbstractDb;
  7. use Magento\Framework\Model\ResourceModel\Db\Context;
  8. /**
  9. * Database Resource Model Fake for Tests
  10. *
  11. * @package Temando\Shipping\Test\Integration
  12. * @author Christoph Aßmann <christoph.assmann@netresearch.de>
  13. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  14. * @link http://www.temando.com/
  15. */
  16. final class ResourceFake extends AbstractDb
  17. {
  18. /**
  19. * Constructor
  20. *
  21. * @param Context $context
  22. * @param string $connectionName
  23. * @param string $idFieldName
  24. */
  25. public function __construct(Context $context, $connectionName = null, $idFieldName = 'id')
  26. {
  27. $this->_idFieldName = $idFieldName;
  28. parent::__construct($context, $connectionName);
  29. }
  30. /**
  31. * Resource initialization
  32. *
  33. * @return void
  34. */
  35. protected function _construct()
  36. {
  37. }
  38. /**
  39. * Load an object
  40. *
  41. * @param \Magento\Framework\Model\AbstractModel $object
  42. * @param mixed $value
  43. * @param string $field field to load by (defaults to model id)
  44. * @return $this
  45. */
  46. public function load(\Magento\Framework\Model\AbstractModel $object, $value, $field = null)
  47. {
  48. return $this;
  49. }
  50. /**
  51. * Save object object data
  52. *
  53. * @param \Magento\Framework\Model\AbstractModel $object
  54. * @return $this
  55. */
  56. public function save(\Magento\Framework\Model\AbstractModel $object)
  57. {
  58. return $this;
  59. }
  60. /**
  61. * Delete the object
  62. *
  63. * @param \Magento\Framework\Model\AbstractModel $object
  64. * @return $this
  65. */
  66. public function delete(\Magento\Framework\Model\AbstractModel $object)
  67. {
  68. return $this;
  69. }
  70. }