diff --git a/.htaccess b/.htaccess
index bd75f90396737c685c2f95e1c7424d52dc109144..f1ef8719ba1a8421e3d58aeceee851da731e4f77 100644
--- a/.htaccess
+++ b/.htaccess
@@ -170,10 +170,6 @@
 
 </IfModule>
 
-<IfModule mod_env.c>
-    SetEnv MAGE_MODE "developer"
-</IfModule>
-
 ############################################
 ## By default allow all access
 
diff --git a/app/code/Magento/Bundle/Test/Unit/Model/Product/Attribute/Source/Price/ViewTest.php b/app/code/Magento/Bundle/Test/Unit/Model/Product/Attribute/Source/Price/ViewTest.php
index f9020f31d0659276fcb837d71f9313c73e1bc7f8..fef8d5b8006ed4f72c2aaca91fbde4af0e2bd33b 100644
--- a/app/code/Magento/Bundle/Test/Unit/Model/Product/Attribute/Source/Price/ViewTest.php
+++ b/app/code/Magento/Bundle/Test/Unit/Model/Product/Attribute/Source/Price/ViewTest.php
@@ -74,7 +74,7 @@ class ViewTest extends \PHPUnit_Framework_TestCase
     {
         $existValue = 1;
 
-        $this->assertInternalType('string', $this->model->getOptionText($existValue));
+        $this->assertInstanceOf('Magento\Framework\Phrase', $this->model->getOptionText($existValue));
     }
 
     /**
diff --git a/app/code/Magento/Cms/Test/Unit/Block/Adminhtml/Block/EditTest.php b/app/code/Magento/Cms/Test/Unit/Block/Adminhtml/Block/EditTest.php
index 2066261d620cce48c5a99b8b0047e1317325169f..3b0d1837ed3b1dd99d33f5dc0bfe2bb7a3121e4d 100644
--- a/app/code/Magento/Cms/Test/Unit/Block/Adminhtml/Block/EditTest.php
+++ b/app/code/Magento/Cms/Test/Unit/Block/Adminhtml/Block/EditTest.php
@@ -53,7 +53,7 @@ class EditTest extends \PHPUnit_Framework_TestCase
             'Magento\Cms\Block\Adminhtml\Block\Edit',
             [
                 'registry' => $this->registryMock,
-                'escaper' => $this->escaperMock
+                'escaper' => $this->escaperMock,
             ]
         );
     }
@@ -84,14 +84,14 @@ class EditTest extends \PHPUnit_Framework_TestCase
             ->with($title)
             ->willReturn($escapedTitle);
 
-        $this->assertInternalType('string', $this->this->getHeaderText());
+        $this->assertInstanceOf('Magento\Framework\Phrase', $this->this->getHeaderText());
     }
 
     public function getHeaderTextDataProvider()
     {
         return [
             'modelBlockId NOT EMPTY' => ['modelBlockId' => 1],
-            'modelBlockId IS EMPTY' => ['modelBlockId' => null]
+            'modelBlockId IS EMPTY' => ['modelBlockId' => null],
         ];
     }
 }
diff --git a/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php b/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php
index d4b4232878318e83261f61ea71931e613332256d..5922c01bad8a3868bd867b8bd1522d3b2593ef30 100644
--- a/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php
+++ b/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php
@@ -779,7 +779,7 @@ class Configurable extends \Magento\Catalog\Model\Product\Type\AbstractType
                     }
 
                     if (!isset($_result[0])) {
-                        return __('Cannot add the item to shopping cart');
+                        return __('Cannot add the item to shopping cart')->render();
                     }
 
                     /**
diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Account/ConfirmTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Account/ConfirmTest.php
index f1d501361e191699931bfdc24d9336bc62c85d30..a4fe4832056411b7453b2eaa2b8b01ea04d3b010 100644
--- a/app/code/Magento/Customer/Test/Unit/Controller/Account/ConfirmTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Controller/Account/ConfirmTest.php
@@ -171,7 +171,7 @@ class ConfirmTest extends \PHPUnit_Framework_TestCase
                 'customerRepository' => $this->customerRepositoryMock,
                 'addressHelper' => $this->addressHelperMock,
                 'urlFactory' => $urlFactoryMock,
-                'resultRedirectFactory' => $redirectFactoryMock
+                'resultRedirectFactory' => $redirectFactoryMock,
             ]
         );
     }
@@ -388,12 +388,12 @@ class ConfirmTest extends \PHPUnit_Framework_TestCase
             ->with($this->equalTo('*/*/index'), ['_secure' => true])
             ->will($this->returnValue($successUrl));
 
-        $this->redirectMock->expects($this->once())
+        $this->redirectMock->expects($this->never())
             ->method('success')
             ->with($this->equalTo($resultUrl))
             ->will($this->returnValue($resultUrl));
 
-        $this->scopeConfigMock->expects($this->once())
+        $this->scopeConfigMock->expects($this->never())
             ->method('isSetFlag')
             ->with(
                 $this->equalTo(Url::XML_PATH_CUSTOMER_STARTUP_REDIRECT_TO_DASHBOARD),
@@ -426,7 +426,7 @@ class ConfirmTest extends \PHPUnit_Framework_TestCase
                 'http://example.com/success',
                 'http://example.com/success',
                 true,
-                __('Thank you for registering with')
+                __('Thank you for registering with'),
             ],
             [
                 1,
@@ -435,7 +435,7 @@ class ConfirmTest extends \PHPUnit_Framework_TestCase
                 'http://example.com/success',
                 'http://example.com/success',
                 false,
-                __('Thank you for registering with')
+                __('Thank you for registering with'),
             ],
         ];
     }
diff --git a/app/code/Magento/Downloadable/Model/Product/Type.php b/app/code/Magento/Downloadable/Model/Product/Type.php
index 6aa7536e2198eb6b5dcdebe801c3190c80c6806f..ced9222145664e1f2cf569ce6be740993efa48c6 100644
--- a/app/code/Magento/Downloadable/Model/Product/Type.php
+++ b/app/code/Magento/Downloadable/Model/Product/Type.php
@@ -482,7 +482,7 @@ class Type extends \Magento\Catalog\Model\Product\Type\Virtual
             return $result;
         }
         if ($this->getLinkSelectionRequired($product) && $this->_isStrictProcessMode($processMode)) {
-            return __('Please specify product link(s).');
+            return __('Please specify product link(s).')->render();
         }
         return $result;
     }
diff --git a/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php b/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php
index 13f2eb8b93b0bc98833b0443264f05bf3db08752..f44fe22015929528a2d7decdcc81858696c76e11 100644
--- a/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php
+++ b/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php
@@ -262,7 +262,7 @@ class Grouped extends \Magento\Catalog\Model\Product\Type\AbstractType
         if (!$product->hasData($this->_keyStatusFilters)) {
             return [
                 \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED,
-                \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_DISABLED
+                \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_DISABLED,
             ];
         }
         return $product->getData($this->_keyStatusFilters);
@@ -361,7 +361,7 @@ class Grouped extends \Magento\Catalog\Model\Product\Type\AbstractType
                             }
 
                             if (!isset($_result[0])) {
-                                return __('We cannot process the item.');
+                                return __('We cannot process the item.')->render();
                             }
 
                             if ($isStrictProcessMode) {
@@ -399,7 +399,7 @@ class Grouped extends \Magento\Catalog\Model\Product\Type\AbstractType
             }
         }
 
-        return __('Please specify the quantity of product(s).');
+        return __('Please specify the quantity of product(s).')->render();
     }
 
     /**
diff --git a/app/functions.php b/app/functions.php
index b2e8efe5d5706f6e8d99ea70c761203c70af1264..fd363310d8e85b9ea23cf1829074efa031bc3736 100644
--- a/app/functions.php
+++ b/app/functions.php
@@ -18,5 +18,5 @@ function __()
         $argc = $argc[0];
     }
 
-    return (new \Magento\Framework\Phrase($text, $argc))->render();
+    return new \Magento\Framework\Phrase($text, $argc);
 }
diff --git a/dev/tests/static/testsuite/Magento/Test/HhvmCompatibility/IniGetSetTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/HhvmCompatibilityTest.php
similarity index 93%
rename from dev/tests/static/testsuite/Magento/Test/HhvmCompatibility/IniGetSetTest.php
rename to dev/tests/static/testsuite/Magento/Test/Integrity/HhvmCompatibilityTest.php
index 0379a3d89cb354283260e7410c48f330e6a63520..c3a9fe9933ee4948c40bbd5630eea75f0b46a1e0 100644
--- a/dev/tests/static/testsuite/Magento/Test/HhvmCompatibility/IniGetSetTest.php
+++ b/dev/tests/static/testsuite/Magento/Test/Integrity/HhvmCompatibilityTest.php
@@ -6,11 +6,11 @@
  * See COPYING.txt for license details.
  *
  */
-namespace Magento\Test\HhvmCompatibility;
+namespace Magento\Test\Integrity;
 
-use Magento\Framework\Test\Utility\Files;
+use Magento\Framework\App\Utility\Files;
 
-class IniGetSetTest extends \PHPUnit_Framework_TestCase
+class HhvmCompatibilityTest extends \PHPUnit_Framework_TestCase
 {
     /**
      * @var array
@@ -38,7 +38,7 @@ class IniGetSetTest extends \PHPUnit_Framework_TestCase
         'default_socket_timeout',
     ];
 
-    public function testAllowedGetSetDirectives()
+    public function testAllowedIniGetSetDirectives()
     {
         $deniedDirectives = [];
         foreach ($this->getFiles() as $file) {
diff --git a/dev/tools/Magento/Tools/View/deploy.php b/dev/tools/Magento/Tools/View/deploy.php
index 765ac7e4acaddb0e106bfa98f56e8eb96f11ddf3..f380efd3f360d68738842b900cc4372a0af2ddc4 100644
--- a/dev/tools/Magento/Tools/View/deploy.php
+++ b/dev/tools/Magento/Tools/View/deploy.php
@@ -43,7 +43,7 @@ $logger = new \Magento\Tools\View\Deployer\Log($verbosity);
 
 try {
     // run the deployment logic
-    $filesUtil = new \Magento\Framework\Test\Utility\Files(BP);
+    $filesUtil = new \Magento\Framework\App\Utility\Files(BP);
     $omFactory = \Magento\Framework\App\Bootstrap::createObjectManagerFactory(BP, []);
     $objectManager = $omFactory->create(
         [\Magento\Framework\App\State::PARAM_MODE => \Magento\Framework\App\State::MODE_DEFAULT]
diff --git a/lib/internal/Magento/Framework/Test/Unit/PhraseTest.php b/lib/internal/Magento/Framework/Test/Unit/PhraseTest.php
index 7900933be1fb64bdc26eaf4e7b0244c6bf8b16bd..3cae817ba9d3e88f9e84b2e00dc1c1033a04ee07 100644
--- a/lib/internal/Magento/Framework/Test/Unit/PhraseTest.php
+++ b/lib/internal/Magento/Framework/Test/Unit/PhraseTest.php
@@ -92,9 +92,4 @@ class PhraseTest extends \PHPUnit_Framework_TestCase
         $property->setAccessible(true);
         $property->setValue($this->phrase, null);
     }
-
-    public function testGlobalFunction()
-    {
-        $this->assertFalse(is_object(__('Test')));
-    }
 }