diff --git a/app/code/Magento/Catalog/Block/Product/ListProduct.php b/app/code/Magento/Catalog/Block/Product/ListProduct.php
index 73beec6b2b2e1236434d304e1d0fe94e71091662..c28ab40b55364cb60cf301964fe9c6ffce30ce69 100644
--- a/app/code/Magento/Catalog/Block/Product/ListProduct.php
+++ b/app/code/Magento/Catalog/Block/Product/ListProduct.php
@@ -296,7 +296,7 @@ class ListProduct extends AbstractProduct implements IdentityInterface
         }
         $availableOrders = $this->getAvailableOrders();
         if (!$this->getSortBy()) {
-            $categorySortBy = $category->getDefaultSortBy();
+            $categorySortBy = $this->getDefaultSortBy() ?: $category->getDefaultSortBy();
             if ($categorySortBy) {
                 if (!$availableOrders) {
                     $availableOrders = $this->_getConfig()->getAttributeUsedForSortByArray();
diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php b/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php
index c44c68e372aa3bcac5f36923db5470af1c797fe5..4661cfb7110c26fdb4ea0479e425ad09458e8baf 100644
--- a/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php
+++ b/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php
@@ -5,6 +5,7 @@
  */
 namespace Magento\Catalog\Block\Product\ProductList;
 
+use Magento\Catalog\Helper\Product\ProductList;
 use Magento\Catalog\Model\Product\ProductList\Toolbar as ToolbarModel;
 
 /**
@@ -63,7 +64,7 @@ class Toolbar extends \Magento\Framework\View\Element\Template
      *
      * @var string
      */
-    protected $_direction = \Magento\Catalog\Helper\Product\ProductList::DEFAULT_SORT_DIRECTION;
+    protected $_direction = ProductList::DEFAULT_SORT_DIRECTION;
 
     /**
      * Default View mode
@@ -102,7 +103,7 @@ class Toolbar extends \Magento\Framework\View\Element\Template
     protected $_toolbarModel;
 
     /**
-     * @var \Magento\Catalog\Helper\Product\ProductList
+     * @var ProductList
      */
     protected $_productListHelper;
 
@@ -122,7 +123,7 @@ class Toolbar extends \Magento\Framework\View\Element\Template
      * @param \Magento\Catalog\Model\Config $catalogConfig
      * @param ToolbarModel $toolbarModel
      * @param \Magento\Framework\Url\EncoderInterface $urlEncoder
-     * @param \Magento\Catalog\Helper\Product\ProductList $productListHelper
+     * @param ProductList $productListHelper
      * @param \Magento\Framework\Data\Helper\PostHelper $postDataHelper
      * @param array $data
      */
@@ -132,7 +133,7 @@ class Toolbar extends \Magento\Framework\View\Element\Template
         \Magento\Catalog\Model\Config $catalogConfig,
         ToolbarModel $toolbarModel,
         \Magento\Framework\Url\EncoderInterface $urlEncoder,
-        \Magento\Catalog\Helper\Product\ProductList $productListHelper,
+        ProductList $productListHelper,
         \Magento\Framework\Data\Helper\PostHelper $postDataHelper,
         array $data = []
     ) {
@@ -355,7 +356,7 @@ class Toolbar extends \Magento\Framework\View\Element\Template
     }
 
     /**
-     * Compare defined order field vith current order field
+     * Compare defined order field with current order field
      *
      * @param string $order
      * @return bool
@@ -375,7 +376,7 @@ class Toolbar extends \Magento\Framework\View\Element\Template
     {
         $urlParams = [];
         $urlParams['_current'] = true;
-        $urlParams['_escape'] = true;
+        $urlParams['_escape'] = false;
         $urlParams['_use_rewrite'] = true;
         $urlParams['_query'] = $params;
         return $this->getUrl('*/*/*', $urlParams);
@@ -678,7 +679,7 @@ class Toolbar extends \Magento\Framework\View\Element\Template
             'order' => ToolbarModel::ORDER_PARAM_NAME,
             'limit' => ToolbarModel::LIMIT_PARAM_NAME,
             'modeDefault' => $defaultMode,
-            'directionDefault' => \Magento\Catalog\Helper\Product\ProductList::DEFAULT_SORT_DIRECTION,
+            'directionDefault' => $this->_direction ?: ProductList::DEFAULT_SORT_DIRECTION,
             'orderDefault' => $this->_productListHelper->getDefaultSortField(),
             'limitDefault' => $this->_productListHelper->getDefaultLimitPerPageValue($defaultMode),
             'url' => $this->getPagerUrl(),
diff --git a/app/code/Magento/Catalog/Setup/UpgradeData.php b/app/code/Magento/Catalog/Setup/UpgradeData.php
index 5adf385101fc2e67d571c6a3421c46940c685ff8..4c2d32738e88b8aebda1b3d9e2c20a99458a78ba 100644
--- a/app/code/Magento/Catalog/Setup/UpgradeData.php
+++ b/app/code/Magento/Catalog/Setup/UpgradeData.php
@@ -46,21 +46,31 @@ class UpgradeData implements UpgradeDataInterface
             $entityTypeId = $categorySetup->getEntityTypeId(\Magento\Catalog\Model\Product::ENTITY);
             $attributeSetId = $categorySetup->getDefaultAttributeSetId($entityTypeId);
 
-            $attributeGroupId = $categorySetup->getAttributeGroupId($entityTypeId, $attributeSetId, 'Images');
-
-            // update General Group
-            $categorySetup->updateAttributeGroup(
+            $attributeGroup = $categorySetup->getAttributeGroup(
                 $entityTypeId,
                 $attributeSetId,
-                $attributeGroupId,
-                'attribute_group_name',
-                'Images and Videos'
+                'Images',
+                'attribute_group_name'
             );
+            if (isset($attributeGroup['attribute_group_name']) && $attributeGroup['attribute_group_name'] == 'Images') {
+                // update General Group
+                $categorySetup->updateAttributeGroup(
+                    $entityTypeId,
+                    $attributeSetId,
+                    $attributeGroup['attribute_group_id'],
+                    'attribute_group_name',
+                    'Images and Videos'
+                );
+            }
+        }
+
+        if ($context->getVersion()
+            && version_compare($context->getVersion(), '2.0.1') < 0
+        ) {
             $select = $setup->getConnection()->select()
                 ->from(
                     $setup->getTable('catalog_product_entity_group_price'),
                     [
-                        'value_id',
                         'entity_id',
                         'all_groups',
                         'customer_group_id',
@@ -69,11 +79,10 @@ class UpgradeData implements UpgradeDataInterface
                         'website_id'
                     ]
                 );
-            $setup->getConnection()->insertFromSelect(
+            $select = $setup->getConnection()->insertFromSelect(
                 $select,
-                $setup->getTable('catalog_product_entity_group_price'),
+                $setup->getTable('catalog_product_entity_tier_price'),
                 [
-                    'value_id',
                     'entity_id',
                     'all_groups',
                     'customer_group_id',
@@ -82,6 +91,8 @@ class UpgradeData implements UpgradeDataInterface
                     'website_id'
                 ]
             );
+            $setup->getConnection()->query($select);
+
             $categorySetupManager = $this->categorySetupFactory->create();
             $categorySetupManager->removeAttribute(\Magento\Catalog\Model\Product::ENTITY, 'group_price');
         }
diff --git a/app/code/Magento/Catalog/Setup/UpgradeSchema.php b/app/code/Magento/Catalog/Setup/UpgradeSchema.php
index 717f06a0cd58e7f701fd3ec35a829b481740a972..cf92de0f7e6bbe02a2e3b6c292abbcdaf5509cee 100644
--- a/app/code/Magento/Catalog/Setup/UpgradeSchema.php
+++ b/app/code/Magento/Catalog/Setup/UpgradeSchema.php
@@ -140,6 +140,10 @@ class UpgradeSchema implements UpgradeSchemaInterface
      */
     private function addSupportVideoMediaAttributes(SchemaSetupInterface $setup)
     {
+        if ($setup->tableExists(Media::GALLERY_VALUE_TO_ENTITY_TABLE)) {
+            return;
+        };
+
         /** Add support video media attribute */
         $this->createValueToEntityTable($setup);
         /**
diff --git a/app/code/Magento/Catalog/view/frontend/web/js/product/list/toolbar.js b/app/code/Magento/Catalog/view/frontend/web/js/product/list/toolbar.js
index 688f836fb1035c9ef5e98edbcb31f10c59b3f581..5904b567278b7807e308694033e13339afb77d6f 100644
--- a/app/code/Magento/Catalog/view/frontend/web/js/product/list/toolbar.js
+++ b/app/code/Magento/Catalog/view/frontend/web/js/product/list/toolbar.js
@@ -68,7 +68,9 @@ define([
                 parameters;
             for (var i = 0; i < urlParams.length; i++) {
                 parameters = urlParams[i].split('=');
-                paramData[parameters[0]] = parameters[1] !== undefined ? parameters[1] : '';
+                paramData[parameters[0]] = parameters[1] !== undefined
+                    ? window.decodeURIComponent(parameters[1].replace(/\+/g, '%20'))
+                    : '';
             }
             paramData[paramName] = paramValue;
             if (paramValue == defaultValue) {
@@ -81,4 +83,4 @@ define([
     });
 
     return $.mage.productListToolbarForm;
-});
\ No newline at end of file
+});
diff --git a/app/code/Magento/CatalogSearch/Block/Result.php b/app/code/Magento/CatalogSearch/Block/Result.php
index 6c227c058897792627c1b45bd82c3e7919058fec..6670743efd1ce02381a8aec41196d934eb3c4253 100644
--- a/app/code/Magento/CatalogSearch/Block/Result.php
+++ b/app/code/Magento/CatalogSearch/Block/Result.php
@@ -133,12 +133,13 @@ class Result extends Template
         /* @var $category \Magento\Catalog\Model\Category */
         $availableOrders = $category->getAvailableSortByOptions();
         unset($availableOrders['position']);
+        $availableOrders['relevance'] = __('Relevance');
 
         $this->getListBlock()->setAvailableOrders(
             $availableOrders
         )->setDefaultDirection(
             'desc'
-        )->setSortBy(
+        )->setDefaultSortBy(
             'relevance'
         );
 
diff --git a/app/code/Magento/Store/App/Request/PathInfoProcessor.php b/app/code/Magento/Store/App/Request/PathInfoProcessor.php
index ebe3b64aa3b9c90283a41a36a2fa62843ddd819d..ef07979226c54544c0650487071ae7e045255ffa 100644
--- a/app/code/Magento/Store/App/Request/PathInfoProcessor.php
+++ b/app/code/Magento/Store/App/Request/PathInfoProcessor.php
@@ -5,19 +5,21 @@
  */
 namespace Magento\Store\App\Request;
 
+use Magento\Framework\Exception\NoSuchEntityException;
+
 class PathInfoProcessor implements \Magento\Framework\App\Request\PathInfoProcessorInterface
 {
     /**
      * @var \Magento\Store\Model\StoreManagerInterface
      */
-    private $_storeManager;
+    private $storeManager;
 
     /**
      * @param \Magento\Store\Model\StoreManagerInterface $storeManager
      */
     public function __construct(\Magento\Store\Model\StoreManagerInterface $storeManager)
     {
-        $this->_storeManager = $storeManager;
+        $this->storeManager = $storeManager;
     }
 
     /**
@@ -33,14 +35,15 @@ class PathInfoProcessor implements \Magento\Framework\App\Request\PathInfoProces
         $storeCode = $pathParts[0];
 
         try {
-            $store = $this->_storeManager->getStore($storeCode);
-        } catch (\InvalidArgumentException $e) { // TODO: MAGETWO-39826 Need to replace on NoSuchEntityException
+            /** @var \Magento\Store\Api\Data\StoreInterface $store */
+            $store = $this->storeManager->getStore($storeCode);
+        } catch (NoSuchEntityException $e) {
             return $pathInfo;
         }
 
         if ($store->isUseStoreInUrl()) {
             if (!$request->isDirectAccessFrontendName($storeCode)) {
-                $this->_storeManager->setCurrentStore($storeCode);
+                $this->storeManager->setCurrentStore($storeCode);
                 $pathInfo = '/' . (isset($pathParts[1]) ? $pathParts[1] : '');
                 return $pathInfo;
             } elseif (!empty($storeCode)) {
diff --git a/app/code/Magento/Store/Controller/Store/SwitchAction.php b/app/code/Magento/Store/Controller/Store/SwitchAction.php
index 647b2cf6c320f7e6f277fd155d9bf52232a450cf..b527b7ad4fe702f5194e115229d0bb4699388ca0 100644
--- a/app/code/Magento/Store/Controller/Store/SwitchAction.php
+++ b/app/code/Magento/Store/Controller/Store/SwitchAction.php
@@ -9,6 +9,7 @@ namespace Magento\Store\Controller\Store;
 use Magento\Framework\App\Action\Action;
 use Magento\Framework\App\Action\Context as ActionContext;
 use Magento\Framework\App\Http\Context as HttpContext;
+use Magento\Framework\Exception\NoSuchEntityException;
 use Magento\Store\Api\StoreCookieManagerInterface;
 use Magento\Store\Api\StoreRepositoryInterface;
 use Magento\Store\Model\Store;
@@ -78,7 +79,7 @@ class SwitchAction extends Action
             $store = $this->storeRepository->getActiveStoreByCode($storeCode);
         } catch (StoreIsInactiveException $e) {
             $error = __('Requested store is inactive');
-        } catch (\InvalidArgumentException $e) {
+        } catch (NoSuchEntityException $e) {
             $error = __('Requested store is not found');
         }
 
diff --git a/app/code/Magento/Store/Model/StoreRepository.php b/app/code/Magento/Store/Model/StoreRepository.php
index de3c80adf2b50a3506ee5907faebdcde13e0df2d..3b2d9bcd03a4f047043dc444ceca081e6007ebd2 100644
--- a/app/code/Magento/Store/Model/StoreRepository.php
+++ b/app/code/Magento/Store/Model/StoreRepository.php
@@ -57,8 +57,7 @@ class StoreRepository implements \Magento\Store\Api\StoreRepositoryInterface
         $store = $this->storeFactory->create();
         $store->load($code, 'code');
         if ($store->getId() === null) {
-            // TODO: MAGETWO-39826 Need to replace on NoSuchEntityException
-            throw new \InvalidArgumentException();
+            throw new NoSuchEntityException(__('Requested store is not found'));
         }
         $this->entities[$code] = $store;
         $this->entitiesById[$store->getId()] = $store;
@@ -89,7 +88,7 @@ class StoreRepository implements \Magento\Store\Api\StoreRepositoryInterface
         $store = $this->storeFactory->create();
         $store->load($id);
         if ($store->getId() === null) {
-            throw new NoSuchEntityException();
+            throw new NoSuchEntityException(__('Requested store is not found'));
         }
         $this->entitiesById[$id] = $store;
         $this->entities[$store->getCode()] = $store;
diff --git a/app/code/Magento/Store/Model/StoreResolver.php b/app/code/Magento/Store/Model/StoreResolver.php
index 79a6e53423c79fc953185864180f8fcbae4a41f7..1f37a8611a2772fcab985224bff9b9fe8db8650b 100644
--- a/app/code/Magento/Store/Model/StoreResolver.php
+++ b/app/code/Magento/Store/Model/StoreResolver.php
@@ -137,14 +137,9 @@ class StoreResolver implements \Magento\Store\Api\StoreResolverInterface
         try {
             $store = $this->storeRepository->getActiveStoreByCode($storeCode);
         } catch (StoreIsInactiveException $e) {
-            $error = __('Requested store is inactive');
-        } catch (\InvalidArgumentException $e) { // TODO: MAGETWO-39826 Need to replace on NoSuchEntityException
-            $error = __('Requested store is not found');
+            throw new NoSuchEntityException(__('Requested store is inactive'));
         }
 
-        if (isset($error, $e)) {
-            throw new NoSuchEntityException($error, $e);
-        }
         return $store;
     }
 
@@ -160,14 +155,9 @@ class StoreResolver implements \Magento\Store\Api\StoreResolverInterface
         try {
             $store = $this->storeRepository->getActiveStoreById($id);
         } catch (StoreIsInactiveException $e) {
-            $error = __('Default store is inactive');
-        } catch (\InvalidArgumentException $e) { // TODO: MAGETWO-39826 Need to replace on NoSuchEntityException
-            $error = __('Default store is not found');
+            throw new NoSuchEntityException(__('Default store is inactive'));
         }
 
-        if (isset($error, $e)) {
-            throw new NoSuchEntityException($error, $e);
-        }
         return $store;
     }
 }
diff --git a/app/code/Magento/Store/Test/Unit/App/Request/PathInfoProcessorTest.php b/app/code/Magento/Store/Test/Unit/App/Request/PathInfoProcessorTest.php
index b81f0a6544f2327e0841362790f1c2260d2ca053..9ba184b950995a49cd6b6618e6d76a013717e6b9 100644
--- a/app/code/Magento/Store/Test/Unit/App/Request/PathInfoProcessorTest.php
+++ b/app/code/Magento/Store/Test/Unit/App/Request/PathInfoProcessorTest.php
@@ -5,6 +5,8 @@
  */
 namespace Magento\Store\Test\Unit\App\Request;
 
+use Magento\Framework\Exception\NoSuchEntityException;
+
 class PathInfoProcessorTest extends \PHPUnit_Framework_TestCase
 {
     /**
@@ -112,8 +114,7 @@ class PathInfoProcessorTest extends \PHPUnit_Framework_TestCase
     {
         $store = $this->getMock('\Magento\Store\Model\Store', [], [], '', false);
         $this->_storeManagerMock->expects($this->once())->method('getStore')->with('storeCode')
-            // TODO: MAGETWO-39826 Need to replace on NoSuchEntityException
-            ->willThrowException(new \InvalidArgumentException());
+            ->willThrowException(new NoSuchEntityException());
         $store->expects($this->never())->method('isUseStoreInUrl');
         $this->_requestMock->expects($this->never())->method('isDirectAccessFrontendName');
 
diff --git a/dev/tests/integration/testsuite/Magento/Store/App/Request/PathInfoProcessorTest.php b/dev/tests/integration/testsuite/Magento/Store/App/Request/PathInfoProcessorTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..8470436c8bd3e75a78306af4cd2897c0705ddeac
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Store/App/Request/PathInfoProcessorTest.php
@@ -0,0 +1,106 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Store\App\Request;
+
+use \Magento\TestFramework\Helper\Bootstrap;
+use \Magento\Store\Model\ScopeInterface;
+use \Magento\Store\Model\Store;
+
+class PathInfoProcessorTest extends \PHPUnit_Framework_TestCase
+{
+    /**
+     * @var \Magento\Store\App\Request\PathInfoProcessor
+     */
+    protected $pathProcessor;
+
+    protected function setUp()
+    {
+        $this->pathProcessor = Bootstrap::getObjectManager()->create('Magento\Store\App\Request\PathInfoProcessor');
+    }
+
+    /**
+     * @covers \Magento\Store\App\Request\PathInfoProcessor::process
+     * @dataProvider notValidStoreCodeDataProvider
+     */
+    public function testProcessNotValidStoreCode($pathInfo)
+    {
+        /** @var \Magento\Framework\App\RequestInterface $request */
+        $request = Bootstrap::getObjectManager()->create('Magento\Framework\App\RequestInterface');
+        $this->assertEquals($pathInfo, $this->pathProcessor->process($request, $pathInfo));
+    }
+
+    public function notValidStoreCodeDataProvider()
+    {
+        return [
+            ['not_valid_store_code_int' => '/100500/m/c/a'],
+            ['not_valid_store_code_str' => '/test_string/m/c/a'],
+        ];
+    }
+
+    /**
+     * @covers \Magento\Store\App\Request\PathInfoProcessor::process
+     * @magentoDataFixture Magento/Store/_files/core_fixturestore.php
+     */
+    public function testProcessValidStoreCodeCase1()
+    {
+        /** @var \Magento\Store\Model\Store $store */
+        $store = Bootstrap::getObjectManager()->get('Magento\Store\Model\Store');
+        $store->load('fixturestore', 'code');
+
+        /** @var \Magento\Framework\App\RequestInterface $request */
+        $request = Bootstrap::getObjectManager()->create('Magento\Framework\App\RequestInterface');
+
+        /** @var \Magento\Framework\App\Config\ReinitableConfigInterface $config */
+        $config = Bootstrap::getObjectManager()->get('\Magento\Framework\App\Config\ReinitableConfigInterface');
+        $config->setValue(Store::XML_PATH_STORE_IN_URL, false, ScopeInterface::SCOPE_STORE, $store->getCode());
+        $pathInfo = sprintf('/%s/m/c/a', $store->getCode());
+        $this->assertEquals($pathInfo, $this->pathProcessor->process($request, $pathInfo));
+    }
+
+    /**
+     * @covers \Magento\Store\App\Request\PathInfoProcessor::process
+     * @magentoDataFixture Magento/Store/_files/core_fixturestore.php
+     */
+    public function testProcessValidStoreCodeCase2()
+    {
+        /** @var \Magento\Store\Model\Store $store */
+        $store = Bootstrap::getObjectManager()->get('Magento\Store\Model\Store');
+        $store->load('fixturestore', 'code');
+
+        /** @var \Magento\Framework\App\RequestInterface $request */
+        $request = Bootstrap::getObjectManager()->create('Magento\Framework\App\RequestInterface');
+
+        /** @var \Magento\Framework\App\Config\ReinitableConfigInterface $config */
+        $config = Bootstrap::getObjectManager()->get('\Magento\Framework\App\Config\ReinitableConfigInterface');
+        $config->setValue(Store::XML_PATH_STORE_IN_URL, true, ScopeInterface::SCOPE_STORE, $store->getCode());
+        $pathInfo = sprintf('/%s/m/c/a', $store->getCode());
+        $this->assertEquals('/m/c/a', $this->pathProcessor->process($request, $pathInfo));
+    }
+
+    /**
+     * @covers \Magento\Store\App\Request\PathInfoProcessor::process
+     * @magentoDataFixture Magento/Store/_files/core_fixturestore.php
+     */
+    public function testProcessValidStoreCodeCase3()
+    {
+        /** @var \Magento\Store\Model\Store $store */
+        $store = Bootstrap::getObjectManager()->get('Magento\Store\Model\Store');
+        $store->load('fixturestore', 'code');
+
+        /** @var \Magento\Framework\App\RequestInterface $request */
+        $request = Bootstrap::getObjectManager()->create(
+            'Magento\Framework\App\RequestInterface',
+            ['directFrontNames' => [$store->getCode() => true]]
+        );
+
+        /** @var \Magento\Framework\App\Config\ReinitableConfigInterface $config */
+        $config = Bootstrap::getObjectManager()->get('\Magento\Framework\App\Config\ReinitableConfigInterface');
+        $config->setValue(Store::XML_PATH_STORE_IN_URL, true, ScopeInterface::SCOPE_STORE, $store->getCode());
+        $pathInfo = sprintf('/%s/m/c/a', $store->getCode());
+        $this->assertEquals($pathInfo, $this->pathProcessor->process($request, $pathInfo));
+        $this->assertEquals('noroute', $request->getActionName());
+    }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/AclConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/AclConfigFilesTest.php
index 7863c4201bd73d77dc7ab1ff4bbc1eb3cefb2c12..c998094fc963a3b525515d662743fbea282d8e82 100644
--- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/AclConfigFilesTest.php
+++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/AclConfigFilesTest.php
@@ -5,7 +5,6 @@
  */
 namespace Magento\Test\Integrity\Modular;
 
-use Magento\Framework\App\Filesystem\DirectoryList;
 
 class AclConfigFilesTest extends \PHPUnit_Framework_TestCase
 {
diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/DiConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/DiConfigFilesTest.php
index 79b69588428780b553ff4bc8513e573aacc7bc81..42b6a74d7e06d84479dcb2fc13326905dedaf2c1 100644
--- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/DiConfigFilesTest.php
+++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/DiConfigFilesTest.php
@@ -92,7 +92,7 @@ class DiConfigFilesTest extends \PHPUnit_Framework_TestCase
 
         $output = [];
         foreach ($common as $path => $file) {
-            $output[$path] = [$file];
+            $output[substr($path, strlen(BP))] = [$file];
         }
 
         return $output;
diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/IndexerConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/IndexerConfigFilesTest.php
index 5a330a83dbe836640ece9461625fc7b04f26792e..f12917f9c456deeea853cda63ec8005182bec8ee 100644
--- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/IndexerConfigFilesTest.php
+++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/IndexerConfigFilesTest.php
@@ -5,7 +5,6 @@
  */
 namespace Magento\Test\Integrity\Modular;
 
-use Magento\Framework\App\Filesystem\DirectoryList;
 use Magento\Framework\Filesystem;
 
 class IndexerConfigFilesTest extends \PHPUnit_Framework_TestCase
@@ -51,13 +50,6 @@ class IndexerConfigFilesTest extends \PHPUnit_Framework_TestCase
      */
     public function indexerConfigFileDataProvider()
     {
-        /** @var Filesystem $filesystem */
-        $utilityFiles = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
-            ->get('\Magento\Framework\App\Utility\Files');
-
-        $utilityFiles->getConfigFiles('indexer.xml');
-
-        $dataProviderResult = $utilityFiles->getConfigFiles('indexer.xml');
-        return $dataProviderResult;
+        return \Magento\Framework\App\Utility\Files::init()->getConfigFiles('indexer.xml');
     }
 }
diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/XmlFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/XmlFilesTest.php
index ca81ea4973a098eadb1bc87d8bbcb0eca2fa70e1..95a9bb0d8cb7babcddd36aa3413363ee761ac021 100644
--- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/XmlFilesTest.php
+++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/XmlFilesTest.php
@@ -36,7 +36,7 @@ class XmlFilesTest extends \PHPUnit_Framework_TestCase
             ->get('Magento\Framework\Component\DirSearch');
         $files = $componentDirSearch->collectFiles(ComponentRegistrar::THEME, 'etc/view.xml');
         foreach ($files as $file) {
-            $result[$file] = [$file];
+            $result[substr($file, strlen(BP))] = [$file];
         }
         return $result;
     }
@@ -60,7 +60,7 @@ class XmlFilesTest extends \PHPUnit_Framework_TestCase
         $componentRegistrar = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
             ->get('\Magento\Framework\Component\ComponentRegistrar');
         foreach ($componentRegistrar->getPaths(ComponentRegistrar::THEME) as $themeDir) {
-            $result[$themeDir] = [$themeDir];
+            $result[substr($themeDir, strlen(BP))] = [$themeDir];
         }
         return $result;
     }
@@ -102,7 +102,7 @@ class XmlFilesTest extends \PHPUnit_Framework_TestCase
             ->get('Magento\Framework\Component\DirSearch');
         $files = $componentDirSearch->collectFiles(ComponentRegistrar::THEME, 'theme.xml');
         foreach ($files as $file) {
-            $result[$file] = [$file];
+            $result[substr($file, strlen(BP))] = [$file];
         }
         return $result;
     }
diff --git a/lib/internal/Magento/Framework/App/Utility/Files.php b/lib/internal/Magento/Framework/App/Utility/Files.php
index e19dd388fc6d3845cab20e101ef4535086cc59d6..7802320f6fc32b2bf77b106237f35ddde8699f43 100644
--- a/lib/internal/Magento/Framework/App/Utility/Files.php
+++ b/lib/internal/Magento/Framework/App/Utility/Files.php
@@ -106,7 +106,7 @@ class Files
     {
         $result = [];
         foreach ($files as $file) {
-            $result[$file] = [$file];
+            $result[substr($file, strlen(BP))] = [$file];
         }
         return $result;
     }