diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/MenuTest.php b/dev/tests/integration/testsuite/Magento/Backend/Block/MenuTest.php
index 1723b9a7030c88616bafc55462b75bbb566ec296..c3988187c686d939206c045c4dd9a78d2422de6c 100644
--- a/dev/tests/integration/testsuite/Magento/Backend/Block/MenuTest.php
+++ b/dev/tests/integration/testsuite/Magento/Backend/Block/MenuTest.php
@@ -40,18 +40,18 @@ class MenuTest extends \PHPUnit_Framework_TestCase
         );
         $this->configCacheType->save('', \Magento\Backend\Model\Menu\Config::CACHE_MENU_OBJECT);
 
+        $reflection = new \ReflectionClass(\Magento\Framework\Component\ComponentRegistrar::class);
+        $paths = $reflection->getProperty('paths');
+        $paths->setAccessible(true);
+        $this->backupRegistrar = $paths->getValue();
+        $paths->setAccessible(false);
+
         $this->menuConfig = $this->prepareMenuConfig();
 
         $this->blockMenu = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
             \Magento\Backend\Block\Menu::class,
             ['menuConfig' => $this->menuConfig]
         );
-
-        $reflection = new \ReflectionClass(\Magento\Framework\Component\ComponentRegistrar::class);
-        $paths = $reflection->getProperty('paths');
-        $paths->setAccessible(true);
-        $this->backupRegistrar = $paths->getValue();
-        $paths->setAccessible(false);
     }
 
     /**