{"id":346682,"date":"2022-08-04T07:59:49","date_gmt":"2022-08-04T07:59:49","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=346682"},"modified":"2022-08-16T11:22:27","modified_gmt":"2022-08-16T11:22:27","slug":"object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce\/","title":{"rendered":"Object Mocking in Unit Test Magento 2 Open Source and Adobe Commerce"},"content":{"rendered":"\n<p>In Unit Testing, mocking is the most important part of testing a single unit is that you want to simulate the surrounding around it which is the dependencies of that class.<\/p>\n\n\n\n<p><strong>For example<\/strong> : If you&#8217;re testing a single unit that needs to process some output of a database, you don&#8217;t want to perform an actual query on a live database, you&#8217;d rather&nbsp;mock&nbsp;the database dependency to make sure that for your test it will always return a certain set of data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Benefits of mock objects<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>The unit test will run quickly in case of mocking databases, file systems, or external services.<\/li><li>Useful for testing external objects that produce nondeterministic results.<\/li><\/ul>\n\n\n\n<p>PHP Unit provides multiple methods that will automatically create mock objects which will replace the original object in a unit test.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>createMock<\/strong> <strong>:<\/strong><\/li><\/ul>\n\n\n\n<p>It uses the&nbsp;<strong>getMockBuilder<\/strong>&nbsp;method to create a test double for the specified class. It disabled the constructor of the original class.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace namespace Webkul\\UnitTest\\Test\\Unit\\Helper;\n\nclass DataTest extends \\PHPUnit\\Framework\\TestCase\n{\n    \/**\n     * Set up\n     *\n     * @return void\n     *\/\n    protected function setUp(): void\n    {\n        $this-&gt;context = $this-&gt;createMock(\n            \\Magento\\Framework\\App\\Helper\\Context::class\n        );\n    }\n}<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>createPartialMock :<\/strong><\/li><\/ul>\n\n\n\n<p>The&nbsp;<strong>createPartialMock<\/strong>&nbsp;method is very similar to&nbsp;<strong>createMock<\/strong>&nbsp;but it lets you specify an array with a subset of methods to be mocked (<strong>createMock<\/strong>&nbsp;doesn&#8217;t mock any method by default). This is especially useful in Magento 2 when mocking factories since you will need the&nbsp;<code>create<\/code>&nbsp;method of the factory to be mocked.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace namespace Webkul\\UnitTest\\Test\\Unit\\Helper;\n\nclass DataTest extends \\PHPUnit\\Framework\\TestCase\n{\n    \/**\n     * Set up\n     *\n     * @return void\n     *\/\n    protected function setUp(): void\n    {\n        $this-&gt;customerMock = $this-&gt;getMockBuilder(\n            \\Magento\\Customer\\Model\\Customer::class,\n        )-&gt;setMethods(&#091;\n            &#039;setStore&#039;,\n            &#039;loadByEmail&#039;,\n            &#039;getEntityId&#039;,\n            &#039;setPassword&#039;,\n            &#039;save&#039;\n        ])-&gt;disableOriginalConstructor()-&gt;getMock();\n        \n        $this-&gt;customerFactoryMock = $this-&gt;createPartialMock(\n            \\Magento\\Customer\\Model\\CustomerFactory::class,\n            &#091;&#039;create&#039;]\n        );\n        $this-&gt;customerFactoryMock-&gt;expects($this-&gt;any())\n            -&gt;method(&#039;create&#039;)\n            -&gt;willReturn($this-&gt;returnValue($this-&gt;customerMock));\n    }\n}<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>createConfiguredMock :<\/strong><\/li><\/ul>\n\n\n\n<p>Similar to&nbsp;<strong>createMock<\/strong>&nbsp;but accepts a configuration array with a list of methods and their corresponding return values. Internally, it sets the&nbsp;<code>willReturn<\/code>&nbsp;value for the methods specified.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace namespace Webkul\\UnitTest\\Test\\Unit\\Helper;\n\nuse Magento\\Framework\\App\\ResourceConnection;\nuse Magento\\Framework\\DB\\Adapter\\Pdo\\Mysql;\n\nclass DataTest extends \\PHPUnit\\Framework\\TestCase\n{\n    \/**\n     * @var Mysql|MockObject\n     *\/\n    private $adapterMock;\n    \n    \/**\n     * Set up\n     *\n     * @return void\n     *\/\n    protected function setUp(): void\n    {\n        $this-&gt;adapterMock = $this-&gt;createMock(Mysql::class);\n\n        $this-&gt;resourceConnectionMock = $this-&gt;createConfiguredMock(\n        ResourceConnection::class,\n            &#091;\n                &#039;getConnection&#039; =&gt; $this-&gt;adapterMock,\n                &#039;getTableName&#039;  =&gt; self::PREFIXED_TABLE_MEDIA_GALLERY_ASSET\n            ]\n        );\n    }\n}<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>getMockBuilder<\/strong> :<\/li><\/ul>\n\n\n\n<p>getMockBuilder will mock the object using its fluent interface.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace namespace Webkul\\UnitTest\\Test\\Unit\\Helper;\n\nclass DataTest extends \\PHPUnit\\Framework\\TestCase\n{\n    \/**\n     * Set up\n     *\n     * @return void\n     *\/\n    protected function setUp(): void\n    {\n        $this-&gt;customerMock = $this-&gt;getMockBuilder(\n            \\Magento\\Customer\\Model\\Customer::class,\n        )-&gt;setMethods(&#091;\n            &#039;setStore&#039;,\n            &#039;loadByEmail&#039;,\n            &#039;getEntityId&#039;,\n            &#039;setPassword&#039;,\n            &#039;save&#039;\n        ])-&gt;disableOriginalConstructor()-&gt;getMock();\n    }\n}<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>getMockForAbstractClass<\/strong> :<\/li><\/ul>\n\n\n\n<p>It uses the&nbsp;<strong>getMockBuilder<\/strong>&nbsp;method to create a test double for the specified class. It disables the constructor of the original class and uses for abstract classes or Interfaces.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace namespace Webkul\\UnitTest\\Test\\Unit\\Helper;\n\nuse Magento\\Store\\Model\\StoreManagerInterface;\n\nclass DataTest extends \\PHPUnit\\Framework\\TestCase\n{\n    \/**\n     * @var StoreManagerInterface|MockObject\n     *\/\n    private $storeManager;\n    \n    \/**\n     * Set up\n     *\n     * @return void\n     *\/\n    protected function setUp(): void\n    {\n        $this-&gt;storeManager = $this-&gt;getMockForAbstractClass(\n            StoreManagerInterface::class\n        );\n    }\n}<\/pre>\n\n\n\n<p>After mocking we will know how to use the mocked object expects and its return types.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace namespace Webkul\\UnitTest\\Test\\Unit\\Helper;\n\nuse Magento\\Store\\Model\\StoreManagerInterface;\n\nclass DataTest extends \\PHPUnit\\Framework\\TestCase\n{\n    \/**\n     * @var StoreManagerInterface|MockObject\n     *\/\n    private $storeManager;\n    \n    \/**\n     * Set up\n     *\n     * @return void\n     *\/\n    protected function setUp(): void\n    {\n        $this-&gt;storeManager = $this-&gt;getMockForAbstractClass(\n            StoreManagerInterface::class\n        );\n    }\n\n    public function testUnitTest()\n    {\n        $this-&gt;storeManager-&gt;expects($this-&gt;any())\n            -&gt;method(&#039;getStore&#039;)-&gt;willReturnSelf();\n\n        this-&gt;storeManager-&gt;expects($this-&gt;once())\n            -&gt;method(&#039;getStore&#039;)-&gt;willReturnSelf();\n\n        this-&gt;storeManager-&gt;expects($this-&gt;atLeastOnce())\n            -&gt;method(&#039;getStore&#039;)-&gt;willReturnSelf();\n\n        this-&gt;storeManager-&gt;expects($this-&gt;exactly(3))\n            -&gt;method(&#039;getStore&#039;)-&gt;willReturnSelf();\n\n        this-&gt;storeManager-&gt;expects($this-&gt;never())\n            -&gt;method(&#039;getStore&#039;)-&gt;willReturnSelf();\n    }\n}<\/pre>\n\n\n\n<p>In the above example, the method expects has different types of parameters. It is given below.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>$this-&gt;any():<\/strong> It is for expecting a method many times.<\/li><li><strong>$this-&gt;once() :<\/strong> it is for expecting a method only one time.<\/li><li><strong>$this-&gt;atLeastOnce() :<\/strong> It is for expecting a method at least one time.<\/li><li><strong>$this-&gt;exactly(3)<\/strong>: It is for expecting a method exactly 3 times or you can pass the value as per your requirement.<\/li><li><strong>$this-&gt;never():<\/strong> When expects method takes never as a parameter it will not use that method.<\/li><\/ul>\n\n\n\n<p>Thank\u2019s for reading this. If you have any queries please comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Unit Testing, mocking is the most important part of testing a single unit is that you want to simulate the surrounding around it which is the dependencies of that class. For example : If you&#8217;re testing a single unit that needs to process some output of a database, you don&#8217;t want to perform an <a href=\"https:\/\/webkul.com\/blog\/object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":365,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9121],"tags":[2070,12975,6134,590],"class_list":["post-346682","post","type-post","status-publish","format-standard","hentry","category-magento-2","tag-magento2","tag-object-mocking","tag-unit-testing","tag-webkul"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Object Mocking - Unit Test Magento 2 and Adobe Commerce<\/title>\n<meta name=\"description\" content=\"The most important part of testing a single unit is that you want to simulate the surrounding around it which is the dependency of that class.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Object Mocking - Unit Test Magento 2 and Adobe Commerce\" \/>\n<meta property=\"og:description\" content=\"The most important part of testing a single unit is that you want to simulate the surrounding around it which is the dependency of that class.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-04T07:59:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-08-16T11:22:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Saurav Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Saurav Kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce\/\"},\"author\":{\"name\":\"Saurav Kumar\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/e63462ecf811e98b26fee808c67a6426\"},\"headline\":\"Object Mocking in Unit Test Magento 2 Open Source and Adobe Commerce\",\"datePublished\":\"2022-08-04T07:59:49+00:00\",\"dateModified\":\"2022-08-16T11:22:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce\/\"},\"wordCount\":422,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"keywords\":[\"Magento2\",\"Object Mocking\",\"unit testing\",\"webkul\"],\"articleSection\":[\"Magento 2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce\/\",\"url\":\"https:\/\/webkul.com\/blog\/object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce\/\",\"name\":\"Object Mocking - Unit Test Magento 2 and Adobe Commerce\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"datePublished\":\"2022-08-04T07:59:49+00:00\",\"dateModified\":\"2022-08-16T11:22:27+00:00\",\"description\":\"The most important part of testing a single unit is that you want to simulate the surrounding around it which is the dependency of that class.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Object Mocking in Unit Test Magento 2 Open Source and Adobe Commerce\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/e63462ecf811e98b26fee808c67a6426\",\"name\":\"Saurav Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/decace4591552fae8d7c6b2415e15831d78f0d6edefd9d8a3c79ec51333cce97?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/decace4591552fae8d7c6b2415e15831d78f0d6edefd9d8a3c79ec51333cce97?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Saurav Kumar\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/sauravkumar-magento981\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Object Mocking - Unit Test Magento 2 and Adobe Commerce","description":"The most important part of testing a single unit is that you want to simulate the surrounding around it which is the dependency of that class.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce\/","og_locale":"en_US","og_type":"article","og_title":"Object Mocking - Unit Test Magento 2 and Adobe Commerce","og_description":"The most important part of testing a single unit is that you want to simulate the surrounding around it which is the dependency of that class.","og_url":"https:\/\/webkul.com\/blog\/object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2022-08-04T07:59:49+00:00","article_modified_time":"2022-08-16T11:22:27+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png","type":"image\/png"}],"author":"Saurav Kumar","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Saurav Kumar","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce\/"},"author":{"name":"Saurav Kumar","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/e63462ecf811e98b26fee808c67a6426"},"headline":"Object Mocking in Unit Test Magento 2 Open Source and Adobe Commerce","datePublished":"2022-08-04T07:59:49+00:00","dateModified":"2022-08-16T11:22:27+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce\/"},"wordCount":422,"commentCount":2,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"keywords":["Magento2","Object Mocking","unit testing","webkul"],"articleSection":["Magento 2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce\/","url":"https:\/\/webkul.com\/blog\/object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce\/","name":"Object Mocking - Unit Test Magento 2 and Adobe Commerce","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"datePublished":"2022-08-04T07:59:49+00:00","dateModified":"2022-08-16T11:22:27+00:00","description":"The most important part of testing a single unit is that you want to simulate the surrounding around it which is the dependency of that class.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/object-mocking-in-unit-test-magento-2-open-source-and-adobe-commerce\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Object Mocking in Unit Test Magento 2 Open Source and Adobe Commerce"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/e63462ecf811e98b26fee808c67a6426","name":"Saurav Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/decace4591552fae8d7c6b2415e15831d78f0d6edefd9d8a3c79ec51333cce97?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/decace4591552fae8d7c6b2415e15831d78f0d6edefd9d8a3c79ec51333cce97?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Saurav Kumar"},"url":"https:\/\/webkul.com\/blog\/author\/sauravkumar-magento981\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/346682","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/365"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=346682"}],"version-history":[{"count":15,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/346682\/revisions"}],"predecessor-version":[{"id":347950,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/346682\/revisions\/347950"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=346682"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=346682"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=346682"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}