{"id":111964,"date":"2018-02-10T14:16:32","date_gmt":"2018-02-10T14:16:32","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=111964"},"modified":"2024-08-29T10:15:19","modified_gmt":"2024-08-29T10:15:19","slug":"create-custom-module-magento-2-unit-tests","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/","title":{"rendered":"Unit Test Implementation in Magento 2"},"content":{"rendered":"\n<p>As in the previous blog, we have learned a few <a href=\"https:\/\/webkul.com\/blog\/perform-unit-testing-magento-2\/\">commands to perform unit testing<\/a>. Today we will create a small custom module in Magento 2 and will write test cases for it.<\/p>\n\n\n\n<p>Let&#8217;s start, now I am assuming that you are aware of the Magento Directory structure and know how to <a href=\"https:\/\/webkul.com\/blog\/create-hello-module-in-magento2\/\">create a custom module in Magento 2<\/a>.<\/p>\n\n\n\n<p>In this blog, we are going to create a model for calculator where we can perform basic addition operation.<\/p>\n\n\n\n<p>Step 1: Create your custom module and register it, in my case, I have created a module Webkul_HelloUnitTest.<\/p>\n\n\n\n<p>Step 2: Create a model\u00a0 Calculator here :<br>app\/code\/&lt;vendorname>\/&lt;modulename>\/Model\/Calculator.php<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\nnamespace Webkul\\HelloUnitTest\\Model;\n\nclass Calculator {\n    \/**\n     * This function will perform the addition of two numbers\n     *\n     * @param float $a\n     * @param float $b\n     * @return float\n     *\/\n    public function addition($a ,$b) {\n        return $a + $b;\n    }\n}<\/pre>\n\n\n\n<p>Above We have a class calculator and inside it, there is a function addition that will receive 2 values and return the addition as a result.<\/p>\n\n\n\n<p>Now let&#8217;s create a unit test model for the above.<\/p>\n\n\n\n<p>Step 3:\u00a0 Create a test model here :<br>app\/code\/&lt;vendorname>\/&lt;modulename>\/Test\/Unit\/Model\/Calculator.php<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php\n\nnamespace Webkul\\HelloUnitTest\\Test\\Unit\\Model;\n\nclass Calculator extends  \\PHPUnit\\Framework\\TestCase {\n\n    protected $_objectManager;\n    protected $_desiredResult;\n    protected $_actulResult;\n    protected $_calculator;\n    \/**\n     * Unset the variables and objects after use\n     *\n     * @return void\n     *\/\n    public function tearDown(): void {\n        \n    }\n\n    \/**\n     * Used to set the values to variables or objects.\n     *\n     * @return void\n     *\/\n    public function setUp(): void {\n        $this-&gt;_objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n        $this-&gt;_calculator = $this-&gt;_objectManager-&gt;getObject(\"Webkul\\HelloUnitTest\\Model\\Calculator\");\n        \/\/can do stuff\n    }\n    \/**\n     * This function will perform the addition of two numbers\n     *\n     * @param float $a\n     * @param float $b\n     * @return float\n     *\/\n    public function testAddition() { \n         $this-&gt;_actulResult = $this-&gt;_calculator-&gt;addition(7.0,3.0);\n         $this-&gt;_desiredResult = 10.0;\n         $this-&gt;assertEquals($this-&gt;_desiredResult, $this-&gt;_actulResult);\n    }\n}<\/pre>\n\n\n\n<p>Step 4: Run any of the commands of my previous blog.<br>Here I have a command to run the test for the particular file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">php vendor\/bin\/phpunit -c dev\/tests\/unit\/phpunit.xml.dist app\/code\/Webkul\/HelloUnitTest\/Test\/Unit\/Model\/Calculator.php<\/pre>\n\n\n\n<p>This will return the below output.<br>On Success :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized wp-duotone-unset-1\"><img decoding=\"async\" width=\"719\" height=\"99\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2024\/08\/screenshot27.webp\" alt=\"screenshot27\" class=\"wp-image-459546\" style=\"width:818px;height:auto\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2024\/08\/screenshot27.webp 719w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2024\/08\/screenshot27-300x41.webp 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2024\/08\/screenshot27-250x34.webp 250w\" sizes=\"(max-width: 719px) 100vw, 719px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>On Failure: When I changed the logic to subtract.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized wp-duotone-unset-2\"><img decoding=\"async\" width=\"731\" height=\"274\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2024\/08\/screenshot29.webp\" alt=\"screenshot29\" class=\"wp-image-459547\" style=\"width:820px;height:auto\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2024\/08\/screenshot29.webp 731w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2024\/08\/screenshot29-300x112.webp 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2024\/08\/screenshot29-250x94.webp 250w\" sizes=\"(max-width: 731px) 100vw, 731px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p><strong>A few types of Assertions are as below\u00a0<\/strong>\u00a0:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">assertTrue($x)\tFail if $x is false\nassertFalse($x)\tFail if $x is true\nassertNull($x)\tFail if $x is set\nassertNotNull($x)\tFail if $x not set\nassertIsA($x, $t)\tFail if $x is not the class or type $t\nassertNotA($x, $t)\tFail if $x is of the class or type $t\nassertEqual($x, $y)\tFail if $x == $y is false\nassertNotEqual($x, $y)\tFail if $x == $y is true\nassertWithinMargin($x, $y, $m)\tFail if abs($x - $y) &lt; $m is false\nassertOutsideMargin($x, $y, $m)\tFail if abs($x - $y) &lt; $m is true\nassertIdentical($x, $y)\tFail if $x == $y is false or a type mismatch\nassertNotIdentical($x, $y)\tFail if $x == $y is true and types match\nassertReference($x, $y)\tFail unless $x and $y are the same variable\nassertClone($x, $y)\tFail unless $x and $y are identical copies\nassertPattern($p, $x)\tFail unless the regex $p matches $x\nassertNoPattern($p, $x)\tFail if the regex $p matches $x\nexpectError($x)\tFail if matching error does not occour\nexpectException($x)\tFail if matching exception is not thrown\nignoreException($x)\tSwallows any upcoming matching exception\nassert($e)\tFail on failed expectation object<\/pre>\n\n\n\n<p>Note: If you want to go deep in the topic you can check <a href=\"https:\/\/phpunit.de\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">PHPUnit<\/a>.<\/p>\n\n\n\n<p>If you require technical support, feel free to email us at&nbsp;<a href=\"mailto:support@webkul.com\">support@webkul.com<\/a>.<\/p>\n\n\n\n<p>Additionally, explore a wide array of solutions to boost your store\u2019s capabilities by visiting the&nbsp;<a href=\"https:\/\/store.webkul.com\/Magento-2.html\">Adobe Commerce modules&nbsp;<\/a>section.<\/p>\n\n\n\n<p>For expert advice or to create tailored features,&nbsp;<a href=\"https:\/\/webkul.com\/hire-magento-developers\/\">hire Adobe Commerce Developers<\/a>&nbsp;for your project.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As in the previous blog, we have learned a few commands to perform unit testing. Today we will create a small custom module in Magento 2 and will write test cases for it. Let&#8217;s start, now I am assuming that you are aware of the Magento Directory structure and know how to create a custom <a href=\"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":170,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[302,13],"tags":[2626,353,6161,2059,6160,6133],"class_list":["post-111964","post","type-post","status-publish","format-standard","hentry","category-magento2","category-php","tag-code","tag-custom","tag-example","tag-module","tag-test","tag-unit"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Unit Test Implementation in Magento 2 - Webkul Blog<\/title>\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\/create-custom-module-magento-2-unit-tests\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Unit Test Implementation in Magento 2 - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"As in the previous blog, we have learned a few commands to perform unit testing. Today we will create a small custom module in Magento 2 and will write test cases for it. Let&#8217;s start, now I am assuming that you are aware of the Magento Directory structure and know how to create a custom [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/\" \/>\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=\"2018-02-10T14:16:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-08-29T10:15:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2024\/08\/screenshot27.webp\" \/>\n<meta name=\"author\" content=\"Prabhat Rawat\" \/>\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=\"Prabhat Rawat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/\"},\"author\":{\"name\":\"Prabhat Rawat\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/3d52d6c1ad8a809d2f7548e6a9c3358f\"},\"headline\":\"Unit Test Implementation in Magento 2\",\"datePublished\":\"2018-02-10T14:16:32+00:00\",\"dateModified\":\"2024-08-29T10:15:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/\"},\"wordCount\":282,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2024\/08\/screenshot27.webp\",\"keywords\":[\"code\",\"Custom\",\"example\",\"module\",\"test\",\"Unit\"],\"articleSection\":[\"Magento2\",\"php\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/\",\"url\":\"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/\",\"name\":\"Unit Test Implementation in Magento 2 - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2024\/08\/screenshot27.webp\",\"datePublished\":\"2018-02-10T14:16:32+00:00\",\"dateModified\":\"2024-08-29T10:15:19+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2024\/08\/screenshot27.webp\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2024\/08\/screenshot27.webp\",\"width\":719,\"height\":99},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Unit Test Implementation in Magento 2\"}]},{\"@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\/3d52d6c1ad8a809d2f7548e6a9c3358f\",\"name\":\"Prabhat Rawat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/616ec5deaf63b72b3003cf99e608ae354f4d373cee8d25b2d0bfa65cab270ad8?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\/616ec5deaf63b72b3003cf99e608ae354f4d373cee8d25b2d0bfa65cab270ad8?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Prabhat Rawat\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/prabhat-rawat763\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Unit Test Implementation in Magento 2 - Webkul Blog","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\/create-custom-module-magento-2-unit-tests\/","og_locale":"en_US","og_type":"article","og_title":"Unit Test Implementation in Magento 2 - Webkul Blog","og_description":"As in the previous blog, we have learned a few commands to perform unit testing. Today we will create a small custom module in Magento 2 and will write test cases for it. Let&#8217;s start, now I am assuming that you are aware of the Magento Directory structure and know how to create a custom [...]","og_url":"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2018-02-10T14:16:32+00:00","article_modified_time":"2024-08-29T10:15:19+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2024\/08\/screenshot27.webp","type":"","width":"","height":""}],"author":"Prabhat Rawat","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Prabhat Rawat","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/"},"author":{"name":"Prabhat Rawat","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/3d52d6c1ad8a809d2f7548e6a9c3358f"},"headline":"Unit Test Implementation in Magento 2","datePublished":"2018-02-10T14:16:32+00:00","dateModified":"2024-08-29T10:15:19+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/"},"wordCount":282,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2024\/08\/screenshot27.webp","keywords":["code","Custom","example","module","test","Unit"],"articleSection":["Magento2","php"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/","url":"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/","name":"Unit Test Implementation in Magento 2 - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2024\/08\/screenshot27.webp","datePublished":"2018-02-10T14:16:32+00:00","dateModified":"2024-08-29T10:15:19+00:00","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2024\/08\/screenshot27.webp","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2024\/08\/screenshot27.webp","width":719,"height":99},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/create-custom-module-magento-2-unit-tests\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Unit Test Implementation in Magento 2"}]},{"@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\/3d52d6c1ad8a809d2f7548e6a9c3358f","name":"Prabhat Rawat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/616ec5deaf63b72b3003cf99e608ae354f4d373cee8d25b2d0bfa65cab270ad8?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\/616ec5deaf63b72b3003cf99e608ae354f4d373cee8d25b2d0bfa65cab270ad8?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Prabhat Rawat"},"url":"https:\/\/webkul.com\/blog\/author\/prabhat-rawat763\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/111964","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\/170"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=111964"}],"version-history":[{"count":8,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/111964\/revisions"}],"predecessor-version":[{"id":459567,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/111964\/revisions\/459567"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=111964"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=111964"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=111964"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}