diff --git a/app/bootstrap.php b/app/bootstrap.php
index 5e693487d748d41cd2e2a0259400eaa1798124e5..ec60a1708dacc3d2238960e5b1c9e7c0da05cc92 100644
--- a/app/bootstrap.php
+++ b/app/bootstrap.php
@@ -11,14 +11,14 @@ error_reporting(E_ALL);
 #ini_set('display_errors', 1);
 
 /* PHP version validation */
-if (!defined('PHP_VERSION_ID') || !(PHP_VERSION_ID >= 50600 && PHP_VERSION_ID < 50700 || PHP_VERSION_ID === 70002 || PHP_VERSION_ID >= 70006)) {
+if (!defined('PHP_VERSION_ID') || !(PHP_VERSION_ID >= 50600 && PHP_VERSION_ID < 50700 || PHP_VERSION_ID === 70002 || PHP_VERSION_ID === 70004 || PHP_VERSION_ID >= 70006)) {
     if (PHP_SAPI == 'cli') {
-        echo 'Magento supports PHP 5.6, 7.0.2, and 7.0.6 or later. ' .
+        echo 'Magento supports PHP 5.6, 7.0.2, 7.0.4, and 7.0.6 or later. ' .
             'Please read http://devdocs.magento.com/guides/v1.0/install-gde/system-requirements.html';
     } else {
         echo <<<HTML
 <div style="font:12px/1.35em arial, helvetica, sans-serif;">
-    <p>Magento supports PHP 5.6, 7.0.2, and 7.0.6 or later. Please read
+    <p>Magento supports PHP 5.6, 7.0.2, 7.0.4, and 7.0.6 or later. Please read
     <a target="_blank" href="http://devdocs.magento.com/guides/v1.0/install-gde/system-requirements.html">
     Magento System Requirements</a>.
 </div>
diff --git a/app/code/Magento/AdminNotification/composer.json b/app/code/Magento/AdminNotification/composer.json
index ae24995c35935769b9a2c9812343989c383e1397..0a29908b77f6f4f6511fe5671702217ef95ceb90 100644
--- a/app/code/Magento/AdminNotification/composer.json
+++ b/app/code/Magento/AdminNotification/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-admin-notification",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-backend": "100.2.*",
         "magento/module-media-storage": "100.2.*",
diff --git a/app/code/Magento/AdvancedPricingImportExport/composer.json b/app/code/Magento/AdvancedPricingImportExport/composer.json
index 8388c87e55d8fc121f72d063dfbb8cea517b80b9..65ea7524dffff5bb778aaf5ec7658302072cfaf9 100644
--- a/app/code/Magento/AdvancedPricingImportExport/composer.json
+++ b/app/code/Magento/AdvancedPricingImportExport/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-advanced-pricing-import-export",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-catalog": "101.1.*",
         "magento/module-catalog-inventory": "100.2.*",
         "magento/module-eav": "100.2.*",
diff --git a/app/code/Magento/Authorization/composer.json b/app/code/Magento/Authorization/composer.json
index c8016abf3f743e3ed90b4150dabb33c8a0ac64ea..0ca367d4854dfe5c35811d15aee4d718c0a4edb7 100644
--- a/app/code/Magento/Authorization/composer.json
+++ b/app/code/Magento/Authorization/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-authorization",
     "description": "Authorization module provides access to Magento ACL functionality.",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-backend": "100.2.*",
         "magento/framework": "100.2.*"
     },
diff --git a/app/code/Magento/Authorizenet/composer.json b/app/code/Magento/Authorizenet/composer.json
index d880b3d2c6539c22f666c5cb1a100f81fb4dbcce..0c9e9641b6076850310edd75a2a4ea5ed3ccd094 100644
--- a/app/code/Magento/Authorizenet/composer.json
+++ b/app/code/Magento/Authorizenet/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-authorizenet",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-sales": "100.2.*",
         "magento/module-store": "100.2.*",
         "magento/module-quote": "100.2.*",
diff --git a/app/code/Magento/Backend/composer.json b/app/code/Magento/Backend/composer.json
index 5a535b1331b0f6ed121f0333ec52701135ef4865..7d428636a1f45e23d81879c99baaeef6744518fc 100644
--- a/app/code/Magento/Backend/composer.json
+++ b/app/code/Magento/Backend/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-backend",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-directory": "100.2.*",
         "magento/module-developer": "100.2.*",
diff --git a/app/code/Magento/Backend/view/adminhtml/templates/system/shipping/applicable_country.phtml b/app/code/Magento/Backend/view/adminhtml/templates/system/shipping/applicable_country.phtml
index 1ab29f9fc75994705eab61414a270eca9e953b51..6d003c6cb6810ee05982625e3b67bf6652b65ca2 100644
--- a/app/code/Magento/Backend/view/adminhtml/templates/system/shipping/applicable_country.phtml
+++ b/app/code/Magento/Backend/view/adminhtml/templates/system/shipping/applicable_country.phtml
@@ -37,7 +37,7 @@ CountryModel.prototype = {
             var showMethodElement  = $(applyCountryElement.id.replace(/sallowspecific/, 'showmethod'));
             //var specifErrMsgElement  = $(applyCountryElement.id.replace(/sallowspecific/, 'specificerrmsg'));
             if (specifCountryElement) {
-                if (applyCountryElement.value == 1) {
+                if (applyCountryElement.value == 1 && !specifCountryElement.hasAttribute('disabled')) {
                    //if specific country element selected
                    specifCountryElement.enable();
                    if (showMethodElement) {
diff --git a/app/code/Magento/Backup/composer.json b/app/code/Magento/Backup/composer.json
index a912e1498806f84ef63ebb725926d144de7ae862..21ed6f1780a41348c5bb26556c14fcaa02c08770 100644
--- a/app/code/Magento/Backup/composer.json
+++ b/app/code/Magento/Backup/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-backup",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-backend": "100.2.*",
         "magento/module-cron": "100.2.*",
diff --git a/app/code/Magento/Braintree/Model/Report/Row/TransactionMap.php b/app/code/Magento/Braintree/Model/Report/Row/TransactionMap.php
index 0abae8af89fbca4664c7b35568cf16e61533a3fe..c914b21893e253feb3a04fabe0f4a274d10deb1a 100644
--- a/app/code/Magento/Braintree/Model/Report/Row/TransactionMap.php
+++ b/app/code/Magento/Braintree/Model/Report/Row/TransactionMap.php
@@ -115,9 +115,13 @@ class TransactionMap implements DocumentInterface
      */
     public function getCustomAttributes()
     {
+        $shouldBeLocalized = ['paymentInstrumentType', 'type', 'status'];
         $output = [];
         foreach ($this->getMappedValues() as $key => $value) {
             $attribute = $this->attributeValueFactory->create();
+            if(in_array($key, $shouldBeLocalized)) {
+                $value = __($value);
+            }
             $output[] = $attribute->setAttributeCode($key)->setValue($value);
         }
         return $output;
diff --git a/app/code/Magento/Braintree/Model/Ui/ConfigProvider.php b/app/code/Magento/Braintree/Model/Ui/ConfigProvider.php
index d720b748ba819cce5515d052acde4bfda50c29db..cea02f249cbed4a6da6d7426c0ab20e27fe9cbc9 100644
--- a/app/code/Magento/Braintree/Model/Ui/ConfigProvider.php
+++ b/app/code/Magento/Braintree/Model/Ui/ConfigProvider.php
@@ -79,7 +79,6 @@ final class ConfigProvider implements ConfigProviderInterface
             'payment' => [
                 self::CODE => [
                     'isActive' => $this->config->isActive(),
-                    'isSingleUse' => !$isPayPalActive,
                     'clientToken' => $this->getClientToken(),
                     'ccTypesMapper' => $this->config->getCctypesMapper(),
                     'sdkUrl' => $this->config->getSdkUrl(),
diff --git a/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionMapTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionMapTest.php
index c44a67b2c61d92cabe3087e9a47f20f1b94f9250..34c607c88784d7c270d75937cadfb550216744b1 100644
--- a/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionMapTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionMapTest.php
@@ -11,6 +11,8 @@ use DateTime;
 use Magento\Braintree\Model\Report\Row\TransactionMap;
 use Magento\Framework\Api\AttributeValue;
 use Magento\Framework\Api\AttributeValueFactory;
+use Magento\Framework\Phrase;
+use Magento\Framework\Phrase\RendererInterface;
 use Magento\Store\Model\StoreManagerInterface;
 
 /**
@@ -30,6 +32,16 @@ class TransactionMapTest extends \PHPUnit_Framework_TestCase
      */
     private $attributeValueFactoryMock;
 
+    /**
+     * @var RendererInterface|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private $defaultRenderer;
+
+    /**
+     * @var RendererInterface|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private $rendererMock;
+
     /**
      * Setup
      */
@@ -39,6 +51,9 @@ class TransactionMapTest extends \PHPUnit_Framework_TestCase
             ->setMethods(['create'])
             ->disableOriginalConstructor()
             ->getMock();
+        $this->defaultRenderer = Phrase::getRenderer();
+        $this->rendererMock = $this->getMockBuilder(RendererInterface::class)
+            ->getMock();
     }
 
     /**
@@ -65,6 +80,8 @@ class TransactionMapTest extends \PHPUnit_Framework_TestCase
             $this->transactionStub
         );
 
+        Phrase::setRenderer($this->rendererMock);
+
         /** @var AttributeValue[] $result */
         $result = $map->getCustomAttributes();
 
@@ -77,6 +94,31 @@ class TransactionMapTest extends \PHPUnit_Framework_TestCase
             $result[6]->getValue()
         );
         $this->assertEquals(implode(', ', $transaction['refundIds']), $result[11]->getValue());
+        $this->assertEquals($transaction['merchantAccountId'], $result[1]->getValue());
+        $this->assertEquals($transaction['orderId'], $result[2]->getValue());
+        $this->assertEquals($transaction['amount'], $result[7]->getValue());
+        $this->assertEquals($transaction['processorSettlementResponseCode'], $result[8]->getValue());
+        $this->assertEquals($transaction['processorSettlementResponseText'], $result[10]->getValue());
+        $this->assertEquals($transaction['settlementBatchId'], $result[12]->getValue());
+        $this->assertEquals($transaction['currencyIsoCode'], $result[13]->getValue());
+
+        $this->rendererMock->expects($this->at(0))
+            ->method('render')
+            ->with([$transaction['paymentInstrumentType']])
+            ->willReturn('Credit card');
+        $this->assertEquals('Credit card', $result[3]->getValue()->render());
+
+        $this->rendererMock->expects($this->at(0))
+            ->method('render')
+            ->with([$transaction['type']])
+            ->willReturn('Sale');
+        $this->assertEquals('Sale', $result[5]->getValue()->render());
+
+        $this->rendererMock->expects($this->at(0))
+            ->method('render')
+            ->with([$transaction['status']])
+            ->willReturn('Pending for settlement');
+        $this->assertEquals('Pending for settlement', $result[9]->getValue()->render());
     }
 
     /**
@@ -90,9 +132,27 @@ class TransactionMapTest extends \PHPUnit_Framework_TestCase
                     'id' => 1,
                     'createdAt' => new \DateTime(),
                     'paypalDetails' => new PayPalDetails(['paymentId' => 10]),
-                    'refundIds' => [1, 2, 3, 4, 5]
+                    'refundIds' => [1, 2, 3, 4, 5],
+                    'merchantAccountId' => 'MerchantId',
+                    'orderId' => 1,
+                    'paymentInstrumentType' => 'credit_card',
+                    'type' => 'sale',
+                    'amount' => '$19.99',
+                    'processorSettlementResponseCode' => 1,
+                    'status' => 'pending_for_settlement',
+                    'processorSettlementResponseText' => 'sample text',
+                    'settlementBatchId' => 2,
+                    'currencyIsoCode' => 'USD'
                 ]
             ]
         ];
     }
+
+    /**
+     * @return void
+     */
+    protected function tearDown()
+    {
+        Phrase::setRenderer($this->defaultRenderer);
+    }
 }
diff --git a/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionsCollectionTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionsCollectionTest.php
index 50488df2600c64f1267755b0da98cee69c993789..6024141280a021e443ad100eca65627a4728976c 100644
--- a/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionsCollectionTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionsCollectionTest.php
@@ -184,4 +184,42 @@ class TransactionsCollectionTest extends \PHPUnit_Framework_TestCase
         $this->assertEquals(TransactionsCollection::TRANSACTION_MAXIMUM_COUNT, count($items));
         $this->assertInstanceOf(DocumentInterface::class, $items[1]);
     }
+
+    /**
+     * Add fields to filter
+     * 
+     * @dataProvider addToFilterDataProvider
+     */
+    public function testAddToFilter($field, $condition, $filterMapperCall, $expectedCondition)
+    {
+        $this->filterMapperMock->expects(static::exactly($filterMapperCall))
+            ->method('getFilter')
+            ->with($field, $expectedCondition)
+            ->willReturn(new BraintreeSearchNodeStub());
+
+        $collection = new TransactionsCollection(
+            $this->entityFactoryMock,
+            $this->braintreeAdapterMock,
+            $this->filterMapperMock
+        );
+
+        static::assertInstanceOf(
+            TransactionsCollection::class,
+            $collection->addFieldToFilter($field, $condition)
+        );
+    }
+
+    /**
+     * addToFilter DataProvider
+     * 
+     * @return array
+     */
+    public function addToFilterDataProvider()
+    {
+        return [
+            ['orderId', ['like' => 1], 1, ['like' => 1]],
+            ['type', 'sale', 1, ['eq' => 'sale']],
+            [['type', 'orderId'], [], 0, []],
+        ];
+    }
 }
diff --git a/app/code/Magento/Braintree/Test/Unit/Model/Ui/ConfigProviderTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Ui/ConfigProviderTest.php
index a787111fa93aa383f6ec11b77f3cb2e623bc228e..ad9f99b39afb0820b3b0bcbdca10fbe4837e9a5e 100644
--- a/app/code/Magento/Braintree/Test/Unit/Model/Ui/ConfigProviderTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Model/Ui/ConfigProviderTest.php
@@ -154,7 +154,6 @@ class ConfigProviderTest extends \PHPUnit_Framework_TestCase
                     'payment' => [
                         ConfigProvider::CODE => [
                             'isActive' => true,
-                            'isSingleUse' => false,
                             'clientToken' => self::CLIENT_TOKEN,
                             'ccTypesMapper' => ['visa' => 'VI', 'american-express' => 'AE'],
                             'sdkUrl' => self::SDK_URL,
diff --git a/app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Filters/Type/DateRangeTest.php b/app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Filters/Type/DateRangeTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..b81dbe2fb036f66912c35f7cdf59a88deee6dd51
--- /dev/null
+++ b/app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Filters/Type/DateRangeTest.php
@@ -0,0 +1,251 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Braintree\Test\Unit\Ui\Component\Report\Filters\Type;
+
+use Magento\Framework\Api\Filter;
+use Magento\Framework\Api\FilterBuilder;
+use Magento\Framework\View\Element\UiComponent\DataProvider\DataProviderInterface;
+use Magento\Framework\View\Element\UiComponentFactory;
+use Magento\Ui\Component\Filters\FilterModifier;
+use Magento\Braintree\Ui\Component\Report\Filters\Type\DateRange;
+use Magento\Framework\View\Element\UiComponent\ContextInterface;
+use Magento\Ui\Component\Form\Element\DataType\Date as FormDate;
+
+/**
+ * Class DateRangeTest
+ */
+class DateRangeTest extends \PHPUnit_Framework_TestCase
+{
+    /**
+     * @var ContextInterface|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private $contextMock;
+
+    /**
+     * @var UiComponentFactory|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private $uiComponentFactory;
+
+    /**
+     * @var FilterBuilder|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private $filterBuilderMock;
+
+    /**
+     * @var FilterModifier|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private $filterModifierMock;
+
+
+    /**
+     * @var DataProviderInterface|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private $dataProviderMock;
+
+    /**
+     * Set up
+     */
+    protected function setUp()
+    {
+        $this->contextMock = $this->getMockForAbstractClass(ContextInterface::class);
+        $processor = $this->getMockBuilder(\Magento\Framework\View\Element\UiComponent\Processor::class)
+            ->disableOriginalConstructor()
+            ->getMock();
+        $this->contextMock->expects(static::any())
+            ->method('getProcessor')
+            ->willReturn($processor);
+        $this->uiComponentFactory = $this->getMockBuilder(UiComponentFactory::class)
+            ->setMethods(['create'])
+            ->disableOriginalConstructor()
+            ->getMock();
+        $this->filterBuilderMock = $this->getMockBuilder(FilterBuilder::class)
+            ->disableOriginalConstructor()
+            ->getMock();
+
+        $this->filterModifierMock = $this->getMockBuilder(FilterModifier::class)
+            ->setMethods(['applyFilterModifier'])
+            ->disableOriginalConstructor()
+            ->getMock();
+        
+        $this->dataProviderMock = $this->getMockForAbstractClass(DataProviderInterface::class);
+    }
+
+    /**
+     * Run test prepare method
+     *
+     * @param string $name
+     * @param array $filterData
+     * @param array|null $expectedCondition
+     * @dataProvider getPrepareDataProvider
+     * @return void
+     */
+    public function testPrepare($name, $filterData, $expectedCondition)
+    {
+        /** @var FormDate PHPUnit_Framework_MockObject_MockObject|$uiComponent */
+        $uiComponent = $this->getMockBuilder(FormDate::class)
+            ->disableOriginalConstructor()
+            ->getMock();
+
+        $uiComponent->expects($this->any())
+            ->method('getContext')
+            ->willReturn($this->contextMock);
+
+        $this->contextMock->expects($this->any())
+            ->method('getNamespace')
+            ->willReturn(DateRange::NAME);
+        $this->contextMock->expects($this->any())
+            ->method('addComponentDefinition')
+            ->with(DateRange::NAME, ['extends' => DateRange::NAME]);
+
+        $this->contextMock->expects($this->any())
+            ->method('getFiltersParams')
+            ->willReturn($filterData);
+        
+        $this->contextMock->expects($this->any())
+            ->method('getDataProvider')
+            ->willReturn($this->dataProviderMock);
+
+        if ($expectedCondition !== null) {
+            if (is_string($filterData[$name])) {
+                $uiComponent->expects(static::once())
+                    ->method('convertDate')
+                    ->with($filterData[$name])
+                    ->willReturn(new \DateTime($filterData[$name], new \DateTimeZone('UTC')));
+            } else {
+                $uiComponent->method('convertDate')
+                    ->willReturnMap([
+                        [
+                            $filterData[$name]['from'], 0, 0, 0,
+                            new \DateTime($filterData[$name]['from'], new \DateTimeZone('UTC'))
+                        ],
+                        [
+                            $filterData[$name]['to'], 23, 59, 59,
+                            new \DateTime($filterData[$name]['to'] . ' 23:59:00', new \DateTimeZone('UTC'))
+                        ],
+                    ]);
+            }
+
+            $i=0;
+            switch (true) {
+                case is_string($filterData[$name]):
+                case isset($filterData[$name]['from']) && !isset($filterData[$name]['to']):
+                case !isset($filterData[$name]['from']) && isset($filterData[$name]['to']):
+                    $filterMock = $this->getFilterMock(
+                        $name,
+                        $expectedCondition['type'],
+                        $expectedCondition['date'],
+                        $i
+                    );
+                    $this->dataProviderMock->expects(static::once())
+                        ->method('addFilter')
+                        ->with($filterMock);
+                    break;
+                case isset($filterData[$name]['from']) && isset($filterData[$name]['to']):
+                    $this->getFilterMock(
+                        $name,
+                        $expectedCondition['type_from'],
+                        $expectedCondition['date_from'],
+                        $i
+                    );
+                    $filterMock = $this->getFilterMock(
+                        $name,
+                        $expectedCondition['type_to'],
+                        $expectedCondition['date_to'],
+                        $i
+                    );
+                    $this->dataProviderMock->expects(static::exactly(2))
+                        ->method('addFilter')
+                        ->with($filterMock);
+                    break;
+            }
+        }
+
+        $this->uiComponentFactory->expects($this->any())
+            ->method('create')
+            ->with($name, DateRange::COMPONENT, ['context' => $this->contextMock])
+            ->willReturn($uiComponent);
+
+        $date = new DateRange(
+            $this->contextMock,
+            $this->uiComponentFactory,
+            $this->filterBuilderMock,
+            $this->filterModifierMock,
+            [],
+            ['name' => $name]
+        );
+        $date->prepare();
+    }
+
+    /**
+     * Gets Filter mock
+     * 
+     * @param string $name
+     * @param string $expectedType
+     * @param string $expectedDate
+     * @param int $i
+     * 
+     * @return Filter|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private function getFilterMock($name, $expectedType, $expectedDate, &$i)
+    {
+        $this->filterBuilderMock->expects(static::at($i++))
+            ->method('setConditionType')
+            ->with($expectedType)
+            ->willReturnSelf();
+        $this->filterBuilderMock->expects(static::at($i++))
+            ->method('setField')
+            ->with($name)
+            ->willReturnSelf();
+        $this->filterBuilderMock->expects(static::at($i++))
+            ->method('setValue')
+            ->with($expectedDate)
+            ->willReturnSelf();
+        
+        $filterMock = $this->getMock(Filter::class);
+        $this->filterBuilderMock->expects(static::at($i++))
+            ->method('create')
+            ->willReturn($filterMock);
+
+        return $filterMock;
+    }
+
+    /**
+     * @return array
+     */
+    public function getPrepareDataProvider()
+    {
+        return [
+            [
+                'test_date',
+                ['test_date' => ['from' => '11-05-2015', 'to' => null]],
+                ['date' => '2015-05-11T00:00:00+0000', 'type' => 'gteq'],
+            ],
+            [
+                'test_date',
+                ['test_date' => ['from' => null, 'to' => '11-05-2015']],
+                ['date' => '2015-05-11T23:59:00+0000', 'type' => 'lteq'],
+            ],
+            [
+                'test_date',
+                ['test_date' => ['from' => '11-05-2015', 'to' => '11-05-2015']],
+                [
+                    'date_from' => '2015-05-11T00:00:00+0000', 'type_from' => 'gteq',
+                    'date_to' => '2015-05-11T23:59:00+0000', 'type_to' => 'lteq'
+                ],
+            ],
+            [
+                'test_date',
+                ['test_date' => '11-05-2015'],
+                ['date' => '2015-05-11T00:00:00+0000', 'type' => 'eq'],
+            ],
+            [
+                'test_date',
+                ['test_date' => ['from' => '', 'to' => '']],
+                null,
+            ]
+        ];
+    }
+}
diff --git a/app/code/Magento/Braintree/Ui/Component/Report/Filters/Type/DateRange.php b/app/code/Magento/Braintree/Ui/Component/Report/Filters/Type/DateRange.php
new file mode 100644
index 0000000000000000000000000000000000000000..adbb3b78cb663d92a46e7abdd9c41d70f63e3145
--- /dev/null
+++ b/app/code/Magento/Braintree/Ui/Component/Report/Filters/Type/DateRange.php
@@ -0,0 +1,19 @@
+<?php
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Braintree\Ui\Component\Report\Filters\Type;
+
+/**
+ * Class DateRange
+ */
+class DateRange extends \Magento\Ui\Component\Filters\Type\Date
+{
+    /**
+     * Braintree date format
+     *
+     * @var string
+     */
+    protected static $dateFormat = 'Y-m-d\TH:i:00O';
+}
diff --git a/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/PaymentType.php b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/PaymentType.php
index df6c2ffcd229dd244c8f39a8191ac0955fd936c6..489c0d4cd1e49cd5b788b6927ee09515285b049c 100644
--- a/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/PaymentType.php
+++ b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/PaymentType.php
@@ -44,12 +44,12 @@ class PaymentType implements OptionSourceInterface
     private function getAvailablePaymentTypes()
     {
         return [
-            PaymentInstrumentType::PAYPAL_ACCOUNT => __('Paypal account'),
-            PaymentInstrumentType::COINBASE_ACCOUNT => __('Coinbase account'),
-            PaymentInstrumentType::EUROPE_BANK_ACCOUNT => __('Europe bank account'),
-            PaymentInstrumentType::CREDIT_CARD => __('Credit card'),
-            PaymentInstrumentType::APPLE_PAY_CARD => __('Apple pay card'),
-            PaymentInstrumentType::ANDROID_PAY_CARD => __('Android pay card')
+            PaymentInstrumentType::PAYPAL_ACCOUNT => __(PaymentInstrumentType::PAYPAL_ACCOUNT),
+            PaymentInstrumentType::COINBASE_ACCOUNT => __(PaymentInstrumentType::COINBASE_ACCOUNT),
+            PaymentInstrumentType::EUROPE_BANK_ACCOUNT => __(PaymentInstrumentType::EUROPE_BANK_ACCOUNT),
+            PaymentInstrumentType::CREDIT_CARD => __(PaymentInstrumentType::CREDIT_CARD),
+            PaymentInstrumentType::APPLE_PAY_CARD => __(PaymentInstrumentType::APPLE_PAY_CARD),
+            PaymentInstrumentType::ANDROID_PAY_CARD => __(PaymentInstrumentType::ANDROID_PAY_CARD)
         ];
     }
 }
diff --git a/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/Status.php b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/Status.php
index f5424c6dd9b7f1a1c30b761fe6b3041017191c7e..ca6d6522990b42e11fb4e8230d2c4fee2a64d68e 100644
--- a/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/Status.php
+++ b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/Status.php
@@ -44,20 +44,20 @@ class Status implements OptionSourceInterface
     private function getAvailableStatuses()
     {
         return [
-            Transaction::AUTHORIZATION_EXPIRED => __('Authorization expired'),
-            Transaction::AUTHORIZING => __('Authorizing'),
-            Transaction::AUTHORIZED => __('Authorized'),
-            Transaction::GATEWAY_REJECTED => __('Gateway rejected'),
-            Transaction::FAILED => __('Failed'),
-            Transaction::PROCESSOR_DECLINED => __('Processor declined'),
-            Transaction::SETTLED => __('Settled'),
-            Transaction::SETTLING => __('Settling'),
-            Transaction::SUBMITTED_FOR_SETTLEMENT => __('Submitted for settlement'),
-            Transaction::VOIDED => __('Voided'),
-            Transaction::UNRECOGNIZED => __('Unrecognized'),
-            Transaction::SETTLEMENT_DECLINED => __('Settlement declined'),
-            Transaction::SETTLEMENT_PENDING => __('Settlement pending'),
-            Transaction::SETTLEMENT_CONFIRMED => __('Settlement confirmed')
+            Transaction::AUTHORIZATION_EXPIRED => __(Transaction::AUTHORIZATION_EXPIRED),
+            Transaction::AUTHORIZING => __(Transaction::AUTHORIZING),
+            Transaction::AUTHORIZED => __(Transaction::AUTHORIZED),
+            Transaction::GATEWAY_REJECTED => __(Transaction::GATEWAY_REJECTED),
+            Transaction::FAILED => __(Transaction::FAILED),
+            Transaction::PROCESSOR_DECLINED => __(Transaction::PROCESSOR_DECLINED),
+            Transaction::SETTLED => __(Transaction::SETTLED),
+            Transaction::SETTLING => __(Transaction::SETTLING),
+            Transaction::SUBMITTED_FOR_SETTLEMENT => __(Transaction::SUBMITTED_FOR_SETTLEMENT),
+            Transaction::VOIDED => __(Transaction::VOIDED),
+            Transaction::UNRECOGNIZED => __(Transaction::UNRECOGNIZED),
+            Transaction::SETTLEMENT_DECLINED => __(Transaction::SETTLEMENT_DECLINED),
+            Transaction::SETTLEMENT_PENDING => __(Transaction::SETTLEMENT_PENDING),
+            Transaction::SETTLEMENT_CONFIRMED => __(Transaction::SETTLEMENT_CONFIRMED)
         ];
     }
 }
diff --git a/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/TransactionType.php b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/TransactionType.php
index 312b2f518b4644a3ba5165b877d0bba5b0ed9e4b..0fe752d423277f58c6ee79354541d910a00eb8a8 100644
--- a/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/TransactionType.php
+++ b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/TransactionType.php
@@ -44,8 +44,8 @@ class TransactionType implements OptionSourceInterface
     private function getAvailableTransactionTypes()
     {
         return [
-            Transaction::SALE => __('Sale'),
-            Transaction::CREDIT => __('Credit')
+            Transaction::SALE => __(Transaction::SALE),
+            Transaction::CREDIT => __(Transaction::CREDIT)
         ];
     }
 }
diff --git a/app/code/Magento/Braintree/composer.json b/app/code/Magento/Braintree/composer.json
index fb833f763f370daf493eaf1a16e6791fca7e4f2a..3b77e208837a4a4341baabbae615b7e35b266500 100644
--- a/app/code/Magento/Braintree/composer.json
+++ b/app/code/Magento/Braintree/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-braintree",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/framework": "100.2.*",
         "magento/magento-composer-installer": "*",
         "magento/module-config": "100.2.*",
@@ -17,6 +17,7 @@
         "magento/module-quote": "100.2.*",
         "magento/module-paypal": "100.2.*",
         "magento/module-theme": "100.2.*",
+        "magento/module-ui": "100.2.*",
         "braintree/braintree_php": "3.7.0"
     },
     "suggest": {
diff --git a/app/code/Magento/Braintree/etc/adminhtml/system.xml b/app/code/Magento/Braintree/etc/adminhtml/system.xml
index 3668cd7779fdac701547ecb4d3b7471471943453..765260ce382917554a27b840c27e98ed2c1d8d6a 100644
--- a/app/code/Magento/Braintree/etc/adminhtml/system.xml
+++ b/app/code/Magento/Braintree/etc/adminhtml/system.xml
@@ -18,6 +18,7 @@
                     <label><![CDATA[&nbsp;]]></label>
                     <frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Payment</frontend_model>
                     <attribute type="activity_path">payment/braintree/active</attribute>
+                    <more_url>https://articles.braintreepayments.com/guides/magento/configuration</more_url>
                     <field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0">
                         <label>Enable this Solution</label>
                         <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
@@ -43,7 +44,7 @@
                         </requires>
                     </field>
                     <group id="braintree_required" translate="label" showInDefault="1" showInWebsite="1" sortOrder="5">
-                        <comment><![CDATA[<a href="https://www.braintreegateway.com/login" target="_blank">Click here to login to your existing Braintree account</a>. Or to setup a new account and accept payments on your website, <a href="https://apply.braintreegateway.com/signup/us" target="_blank">click here to signup for a Braintree account</a>.]]></comment>
+                        <comment><![CDATA[<a href="https://www.braintreegateway.com/login" target="_blank">Click here to login to your existing Braintree account</a>. Or to setup a new account and accept payments on your website, <a href="https://apply.braintreegateway.com/signup/us" target="_blank">click here to signup for a Braintree account</a>.<br><br>Powered by <a href="https://www.braintreepayments.com/features/hosted-fields" target="_blank">Braintree v.zero with Hosted Fields</a> latest technology. Hosted Fields are small, transparent iframes that replace the sensitive credit card inputs in your checkout flow - helping you meet the latest data security requirements while ensuring your customization doesn't suffer. <a href="https://www.braintreepayments.com/features/hosted-fields" target="_blank">Find out more</a>.]]></comment>
                         <label>Basic Braintree Settings</label>
                         <attribute type="expanded">1</attribute>
                         <frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
diff --git a/app/code/Magento/Braintree/i18n/en_US.csv b/app/code/Magento/Braintree/i18n/en_US.csv
index f912e59c2edac48bc7da882f692c57802f07b54e..4cdb8538c3abf53b759b94d2adf78178654b9972 100644
--- a/app/code/Magento/Braintree/i18n/en_US.csv
+++ b/app/code/Magento/Braintree/i18n/en_US.csv
@@ -140,6 +140,28 @@ Debug,Debug
 "liabilityShifted", "Liability Shifted"
 "liabilityShiftPossible", "Liability Shift Possible"
 "riskDataId", "Risk ID"
-"riskDataDecision", "Risk Decision",
-"paymentId", "Payment Id",
-"payerEmail", "Payer Email",
+"riskDataDecision", "Risk Decision"
+"paymentId", "Payment Id"
+"payerEmail", "Payer Email"
+"sale","Sale"
+"credit","Credit"
+"authorization_expired","Authorization expired"
+"authorizing","Authorizing"
+"authorized","Authorized"
+"gateway_rejected","Gateway rejected"
+"failed","Failed"
+"processor_declined","Processor declined"
+"settled","Settled"
+"settling","Settling"
+"submitted_for_settlement","Submitted for settlement"
+"voided","Voided"
+"unrecognized","Unrecognized"
+"settlement_declined","Settlement declined"
+"settlement_pending","Settlement pending"
+"settlement_confirmed","Settlement confirmed"
+"paypal_account","Paypal account"
+"coinbase_account","Coinbase account"
+"europe_bank_accout","Europe bank account"
+"credit_card","Credit card"
+"apple_pay_card","Apple pay card"
+"android_pay_card","Android pay card"
\ No newline at end of file
diff --git a/app/code/Magento/Braintree/view/adminhtml/ui_component/braintree_report.xml b/app/code/Magento/Braintree/view/adminhtml/ui_component/braintree_report.xml
index d1b661b2c3ecdf0d6bb92ffc03e3a235e090cb5f..031ddca7a87070ccad2a53a204aec84c67e62f1b 100644
--- a/app/code/Magento/Braintree/view/adminhtml/ui_component/braintree_report.xml
+++ b/app/code/Magento/Braintree/view/adminhtml/ui_component/braintree_report.xml
@@ -109,7 +109,6 @@
                     </item>
                 </argument>
             </filterSelect>
-            <!--
             <filterSelect name="paymentInstrumentType">
                 <argument name="optionsProvider" xsi:type="configurableObject">
                     <argument name="class" xsi:type="string">Magento\Braintree\Ui\Component\Report\Listing\Column\PaymentType</argument>
@@ -126,7 +125,6 @@
                     </item>
                 </argument>
             </filterSelect>
-            -->
             <filterInput name="paypalDetails_paymentId">
                 <argument name="data" xsi:type="array">
                     <item name="config" xsi:type="array">
@@ -135,6 +133,22 @@
                     </item>
                 </argument>
             </filterInput>
+            <filterRange name="createdAt" class="Magento\Braintree\Ui\Component\Report\Filters\Type\DateRange">
+                <argument name="data" xsi:type="array">
+                    <item name="config" xsi:type="array">
+                        <item name="provider" xsi:type="string">${ $.parentName }</item>
+                        <item name="imports" xsi:type="array">
+                            <item name="visible" xsi:type="string">componentType = column, index = ${ $.index }:visible</item>
+                        </item>
+                        <item name="parent" xsi:type="string">braintree_report.braintree_report.listing_top.listing_filters</item>
+                        <item name="template" xsi:type="string">ui/grid/filters/elements/group</item>
+                        <item name="component" xsi:type="string">Magento_Ui/js/grid/filters/range</item>
+                        <item name="rangeType" xsi:type="string">date</item>
+                        <item name="dataScope" xsi:type="string">createdAt</item>
+                        <item name="label" xsi:type="string" translate="true">Created At</item>
+                    </item>
+                </argument>
+            </filterRange>
         </filters>
     </container>
     <columns name="braintree_report_columns">
@@ -216,7 +230,6 @@
             <argument name="data" xsi:type="array">
                 <item name="config" xsi:type="array">
                     <item name="sorting" xsi:type="string">desc</item>
-                    <item name="filter" xsi:type="string">dateRange</item>
                     <item name="dataType" xsi:type="string">date</item>
                     <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>
                     <item name="label" xsi:type="string" translate="true">Created At</item>
diff --git a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/braintree.js b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/braintree.js
index cb0b46a25327e10a54a771c887f60dd3b4817cc3..3cec7f1fb8ccc83ad21c7605918ffaca50d78387 100644
--- a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/braintree.js
+++ b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/braintree.js
@@ -7,26 +7,19 @@
 define(
     [
         'uiComponent',
-        'uiRegistry',
-        'Magento_Braintree/js/view/payment/adapter',
         'Magento_Checkout/js/model/payment/renderer-list'
     ],
     function (
         Component,
-        Registry,
-        Braintree,
         rendererList
     ) {
         'use strict';
 
         var config = window.checkoutConfig.payment,
             braintreeType = 'braintree',
-            payPalType = 'braintree_paypal',
-            path = 'checkout.steps.billing-step.payment.payments-list.',
-            components = [];
+            payPalType = 'braintree_paypal';
 
         if (config[braintreeType].isActive) {
-            components.push(path + braintreeType);
             rendererList.push(
                 {
                     type: braintreeType,
@@ -44,13 +37,6 @@ define(
             );
         }
 
-        // setup Braintree SDK with merged configuration from all related components
-        if (components.length) {
-            Registry.get(components, function () {
-                Braintree.setup();
-            });
-        }
-
         /** Add view logic here if needed */
         return Component.extend({});
     }
diff --git a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js
index 6990c1e2e5a0bb78c52e0075f94995bb0da390ae..af71eb29a158d9c1573eb4dca60026f567afe796 100644
--- a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js
+++ b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js
@@ -61,11 +61,22 @@ define(
                         this.beforePlaceOrder(response);
                     },
 
+                    /**
+                     * Device data initialization
+                     *
+                     * @param {Object} checkout
+                     */
+                    onReady: function (checkout) {
+                        braintree.checkout = checkout;
+                    },
+
                     /**
                      * Triggers on any Braintree error
+                     * @param {Object} response
                      */
-                    onError: function () {
-                        this.paymentMethodNonce = null;
+                    onError: function (response) {
+                        braintree.showError($t('Payment ' + this.getTitle() + ' can\'t be initialized'));
+                        throw response.message;
                     },
 
                     /**
@@ -90,7 +101,7 @@ define(
                 this._super()
                     .observe(['active']);
                 this.validatorManager.initialize();
-                this.initBraintree();
+                this.initClientConfig();
 
                 return this;
             },
@@ -122,11 +133,11 @@ define(
              * @param {Boolean} isActive
              */
             onActiveChange: function (isActive) {
-                if (!isActive || this.isSingleUse()) {
+                if (!isActive) {
                     return;
                 }
 
-                this.reInitBraintree();
+                this.initBraintree();
             },
 
             /**
@@ -146,17 +157,9 @@ define(
             },
 
             /**
-             * Create Braintree configuration
+             * Init Braintree configuration
              */
             initBraintree: function () {
-                this.initClientConfig();
-                braintree.config = _.extend(braintree.config, this.clientConfig);
-            },
-
-            /**
-             * Re-init Braintree configuration
-             */
-            reInitBraintree: function () {
                 var intervalId = setInterval(function () {
                     // stop loader when frame will be loaded
                     if ($('#braintree-hosted-field-number').length) {
@@ -165,6 +168,12 @@ define(
                     }
                 }, 500);
 
+                if (braintree.checkout) {
+                    braintree.checkout.teardown(function () {
+                        braintree.checkout = null;
+                    });
+                }
+
                 fullScreenLoader.startLoader();
                 braintree.setConfig(this.clientConfig);
                 braintree.setup();
@@ -309,14 +318,6 @@ define(
                 });
 
                 return false;
-            },
-
-            /**
-             * Check if Braintree configured without PayPal
-             * @returns {Boolean}
-             */
-            isSingleUse: function () {
-                return window.checkoutConfig.payment[this.getCode()].isSingleUse;
             }
         });
     }
diff --git a/app/code/Magento/Bundle/composer.json b/app/code/Magento/Bundle/composer.json
index 77efd50f8ef2df221460ebf584993cbd60c22bbe..ab587044476db47c0a824cfdb130988f22591971 100644
--- a/app/code/Magento/Bundle/composer.json
+++ b/app/code/Magento/Bundle/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-bundle",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-catalog": "101.1.*",
         "magento/module-tax": "100.2.*",
diff --git a/app/code/Magento/BundleImportExport/composer.json b/app/code/Magento/BundleImportExport/composer.json
index b176f17e0dfce315e26df7f7d0247a9d38e99bd8..3d7900d98287c1eba32a5badd2d5b2fdc1857f25 100644
--- a/app/code/Magento/BundleImportExport/composer.json
+++ b/app/code/Magento/BundleImportExport/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-bundle-import-export",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-catalog": "101.1.*",
         "magento/module-import-export": "100.2.*",
         "magento/module-catalog-import-export": "100.2.*",
diff --git a/app/code/Magento/CacheInvalidate/composer.json b/app/code/Magento/CacheInvalidate/composer.json
index 6b52555f2ac534bab7967dd4e60902d07b1eb98b..cafccadb41ad869ff87ee8eb154c747f569a4c79 100644
--- a/app/code/Magento/CacheInvalidate/composer.json
+++ b/app/code/Magento/CacheInvalidate/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-cache-invalidate",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-page-cache": "100.2.*",
         "magento/framework": "100.2.*"
     },
diff --git a/app/code/Magento/Captcha/composer.json b/app/code/Magento/Captcha/composer.json
index 50ba19c82b8a13e4a92024031143e027709cf747..9d0ce3db92aa402a7c247fed21185953c4707342 100644
--- a/app/code/Magento/Captcha/composer.json
+++ b/app/code/Magento/Captcha/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-captcha",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-customer": "100.2.*",
         "magento/module-checkout": "100.2.*",
diff --git a/app/code/Magento/Catalog/composer.json b/app/code/Magento/Catalog/composer.json
index 3c401b78b2f6d24f7f93af307a7c5d62a80dbe4c..5e638922139b3c8c4404d477fad04838fdcddb95 100644
--- a/app/code/Magento/Catalog/composer.json
+++ b/app/code/Magento/Catalog/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-catalog",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-eav": "100.2.*",
         "magento/module-cms": "101.1.*",
diff --git a/app/code/Magento/CatalogImportExport/composer.json b/app/code/Magento/CatalogImportExport/composer.json
index da6745e141937858e6b1ebf8d219ac899b0613bf..7dbd7f4bc5e656ff09712549886e97a95fa3f4f1 100644
--- a/app/code/Magento/CatalogImportExport/composer.json
+++ b/app/code/Magento/CatalogImportExport/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-catalog-import-export",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-catalog": "101.1.*",
         "magento/module-catalog-url-rewrite": "100.2.*",
         "magento/module-eav": "100.2.*",
diff --git a/app/code/Magento/CatalogInventory/composer.json b/app/code/Magento/CatalogInventory/composer.json
index 409492667e5dd3743270e476addbced423aab686..254d8d2db4bf9db35b338507cdd744d1aaf0e152 100644
--- a/app/code/Magento/CatalogInventory/composer.json
+++ b/app/code/Magento/CatalogInventory/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-catalog-inventory",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-config": "100.2.*",
         "magento/module-store": "100.2.*",
         "magento/module-catalog": "101.1.*",
diff --git a/app/code/Magento/CatalogRule/composer.json b/app/code/Magento/CatalogRule/composer.json
index e89ae17b2cb1f163b46ca16d60c72fe21e4a01f2..71eb5b49db1fc68eadb064968796cfdaf1081d60 100644
--- a/app/code/Magento/CatalogRule/composer.json
+++ b/app/code/Magento/CatalogRule/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-catalog-rule",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-rule": "100.2.*",
         "magento/module-catalog": "101.1.*",
diff --git a/app/code/Magento/CatalogRuleConfigurable/composer.json b/app/code/Magento/CatalogRuleConfigurable/composer.json
index a46ef45dc4f6c7b5b67300da4cbf6740657636f0..994958bb03b8673f054081623a0785bdb7b94482 100644
--- a/app/code/Magento/CatalogRuleConfigurable/composer.json
+++ b/app/code/Magento/CatalogRuleConfigurable/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-catalog-rule-configurable",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-configurable-product": "100.2.*",
         "magento/framework": "100.2.*",
         "magento/magento-composer-installer": "*"
diff --git a/app/code/Magento/CatalogSearch/composer.json b/app/code/Magento/CatalogSearch/composer.json
index d4fda756f4d64c005fc91d7bc0cb39c5e85cd68c..49756420bd2308cd1f8326f474395b6209c7450c 100644
--- a/app/code/Magento/CatalogSearch/composer.json
+++ b/app/code/Magento/CatalogSearch/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-catalog-search",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-catalog": "101.1.*",
         "magento/module-search": "100.2.*",
diff --git a/app/code/Magento/CatalogUrlRewrite/composer.json b/app/code/Magento/CatalogUrlRewrite/composer.json
index 17dde501b9c6b940a1588d803f913e5179ba413e..8fd54cbc8ee8319f625cd6320954a0c821bf9a52 100644
--- a/app/code/Magento/CatalogUrlRewrite/composer.json
+++ b/app/code/Magento/CatalogUrlRewrite/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-catalog-url-rewrite",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-backend": "100.2.*",
         "magento/module-catalog": "101.1.*",
         "magento/module-catalog-import-export": "100.2.*",
diff --git a/app/code/Magento/CatalogWidget/composer.json b/app/code/Magento/CatalogWidget/composer.json
index 3249aae83379a8273e6630bb5cb11628d33de1fb..330f46176286c70822a32762dccfed157a2ce358 100644
--- a/app/code/Magento/CatalogWidget/composer.json
+++ b/app/code/Magento/CatalogWidget/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-catalog-widget",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-catalog": "101.1.*",
         "magento/module-widget": "100.2.*",
         "magento/module-backend": "100.2.*",
diff --git a/app/code/Magento/Checkout/composer.json b/app/code/Magento/Checkout/composer.json
index 6aa7486bc5072026601eff7ff364f9db742b73da..5545e409b65abb3fb381e593c4ec34298dba6b80 100644
--- a/app/code/Magento/Checkout/composer.json
+++ b/app/code/Magento/Checkout/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-checkout",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-sales": "100.2.*",
         "magento/module-backend": "100.2.*",
diff --git a/app/code/Magento/CheckoutAgreements/composer.json b/app/code/Magento/CheckoutAgreements/composer.json
index 734922dff932299a80749f682e4b93b96b363614..afb706a39a25ec97915abfe0bc6bfcb99c95f6d4 100644
--- a/app/code/Magento/CheckoutAgreements/composer.json
+++ b/app/code/Magento/CheckoutAgreements/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-checkout-agreements",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-checkout": "100.2.*",
         "magento/module-quote": "100.2.*",
         "magento/module-store": "100.2.*",
diff --git a/app/code/Magento/Cms/composer.json b/app/code/Magento/Cms/composer.json
index 897f00d3de9b7445fc96f11e34450724cd1ae444..66f6da042e6c9a77e25eb5c9e8f1595c16e3e5f6 100644
--- a/app/code/Magento/Cms/composer.json
+++ b/app/code/Magento/Cms/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-cms",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-theme": "100.2.*",
         "magento/module-widget": "100.2.*",
diff --git a/app/code/Magento/CmsUrlRewrite/composer.json b/app/code/Magento/CmsUrlRewrite/composer.json
index 51e21052772f9117458265fa5680d8645cda3b7e..1ae1efd9350a760846e76fcac8939ef574194361 100644
--- a/app/code/Magento/CmsUrlRewrite/composer.json
+++ b/app/code/Magento/CmsUrlRewrite/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-cms-url-rewrite",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-cms": "101.1.*",
         "magento/module-url-rewrite": "100.2.*",
diff --git a/app/code/Magento/Config/composer.json b/app/code/Magento/Config/composer.json
index 61ca2b198cb9dbcb7888f26fceadbe2bf3a843ed..bdd1a9c14ae6894d052f6e7e2994f2c87c6554b0 100644
--- a/app/code/Magento/Config/composer.json
+++ b/app/code/Magento/Config/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-config",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/framework": "100.2.*",
         "magento/module-store": "100.2.*",
         "magento/module-cron": "100.2.*",
diff --git a/app/code/Magento/ConfigurableImportExport/composer.json b/app/code/Magento/ConfigurableImportExport/composer.json
index af59b7c8de1bbf672dd49ffed506b920a7985caf..6c249134d28626b4c8846fd7491cf25b2e278638 100644
--- a/app/code/Magento/ConfigurableImportExport/composer.json
+++ b/app/code/Magento/ConfigurableImportExport/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-configurable-import-export",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-catalog": "101.1.*",
         "magento/module-catalog-import-export": "100.2.*",
         "magento/module-eav": "100.2.*",
diff --git a/app/code/Magento/ConfigurableProduct/composer.json b/app/code/Magento/ConfigurableProduct/composer.json
index aa2440aa43844c532d5f34f9c32659c54c48ec68..d7441f577c1db1f60381ba2c8caaf64369317542 100644
--- a/app/code/Magento/ConfigurableProduct/composer.json
+++ b/app/code/Magento/ConfigurableProduct/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-configurable-product",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-catalog": "101.1.*",
         "magento/module-catalog-inventory": "100.2.*",
diff --git a/app/code/Magento/Contact/composer.json b/app/code/Magento/Contact/composer.json
index 987eb0bc8c3d82456d46f2a978c442b4fc5a679b..b541f1e7a0ed3afe8f8bfb8c25b7f27282bc9372 100644
--- a/app/code/Magento/Contact/composer.json
+++ b/app/code/Magento/Contact/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-contact",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-config": "100.2.*",
         "magento/module-store": "100.2.*",
         "magento/module-customer": "100.2.*",
diff --git a/app/code/Magento/Cookie/composer.json b/app/code/Magento/Cookie/composer.json
index 5185ac86137bfc9819a6340cfebb12fdd58893df..5222975723385a48adf043f695c08e319f11d57b 100644
--- a/app/code/Magento/Cookie/composer.json
+++ b/app/code/Magento/Cookie/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-cookie",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/framework": "100.2.*"
     },
diff --git a/app/code/Magento/Cron/composer.json b/app/code/Magento/Cron/composer.json
index af92118f5fb58dcdc30401ba6082ab0d16c608a2..b1155c028f91971b5508269a06ebef675032e5b5 100644
--- a/app/code/Magento/Cron/composer.json
+++ b/app/code/Magento/Cron/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-cron",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/framework": "100.2.*"
     },
diff --git a/app/code/Magento/CurrencySymbol/composer.json b/app/code/Magento/CurrencySymbol/composer.json
index d3ce3e959beb61c1f736e662e5bc40c5bd519410..2cdfedadf7a38c7c792a27de4498772cc59c692b 100644
--- a/app/code/Magento/CurrencySymbol/composer.json
+++ b/app/code/Magento/CurrencySymbol/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-currency-symbol",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-config": "100.2.*",
         "magento/module-store": "100.2.*",
         "magento/module-page-cache": "100.2.*",
diff --git a/app/code/Magento/Customer/composer.json b/app/code/Magento/Customer/composer.json
index e845476287b7954bfdadbee714f06317c5a23e7c..74f0ebc2b5e0026acbdc5061949c10ad04aa8d9c 100644
--- a/app/code/Magento/Customer/composer.json
+++ b/app/code/Magento/Customer/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-customer",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-eav": "100.2.*",
         "magento/module-directory": "100.2.*",
diff --git a/app/code/Magento/CustomerImportExport/composer.json b/app/code/Magento/CustomerImportExport/composer.json
index 8aee70d0a240be1d0e2498ee5501d40768ea79bc..533f40c7688e4aa8269bedfe84f5331a772b0b2a 100644
--- a/app/code/Magento/CustomerImportExport/composer.json
+++ b/app/code/Magento/CustomerImportExport/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-customer-import-export",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-backend": "100.2.*",
         "magento/module-customer": "100.2.*",
diff --git a/app/code/Magento/Deploy/composer.json b/app/code/Magento/Deploy/composer.json
index 3d69f9864698a8e6ea74c2b3105d2c6a84a15714..05db53f039027e2ca8e62f490005a782e0dfc088 100644
--- a/app/code/Magento/Deploy/composer.json
+++ b/app/code/Magento/Deploy/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-deploy",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/framework": "100.2.*",
         "magento/module-store": "100.2.*",
         "magento/module-theme": "100.2.*",
diff --git a/app/code/Magento/Developer/composer.json b/app/code/Magento/Developer/composer.json
index 40017ec827ac2d6aaccf7f3230e923109748d164..df2787403f1c1ec63958b2ea351263bfd69c61f6 100644
--- a/app/code/Magento/Developer/composer.json
+++ b/app/code/Magento/Developer/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-developer",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/framework": "100.2.*"
     },
diff --git a/app/code/Magento/Dhl/composer.json b/app/code/Magento/Dhl/composer.json
index 46ebc809ff8d4dff823815b2a505ff1e4e2e2c21..e88cd535952d628628bbc984137430d5370a6ecd 100644
--- a/app/code/Magento/Dhl/composer.json
+++ b/app/code/Magento/Dhl/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-dhl",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-config": "100.2.*",
         "magento/module-store": "100.2.*",
         "magento/module-shipping": "100.2.*",
diff --git a/app/code/Magento/Directory/composer.json b/app/code/Magento/Directory/composer.json
index a59ee693785dab5a39079399db56d8c1bb914112..9b3b253c26a35ed14c4de51c77624a10750ce5f2 100644
--- a/app/code/Magento/Directory/composer.json
+++ b/app/code/Magento/Directory/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-directory",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-config": "100.2.*",
         "magento/module-store": "100.2.*",
         "magento/module-backend": "100.2.*",
diff --git a/app/code/Magento/Downloadable/composer.json b/app/code/Magento/Downloadable/composer.json
index 413bbed80e5be85d60619061b32bbee27f10c124..8d8814740ccd13248b1e7ab903052ca429567ead 100644
--- a/app/code/Magento/Downloadable/composer.json
+++ b/app/code/Magento/Downloadable/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-downloadable",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-catalog": "101.1.*",
         "magento/module-customer": "100.2.*",
diff --git a/app/code/Magento/DownloadableImportExport/composer.json b/app/code/Magento/DownloadableImportExport/composer.json
index 4718b8c13e952f4a85ea8bf477ca40d5155f1f92..c99a0d6d05b822e792e24a27a69f68f240f8b002 100644
--- a/app/code/Magento/DownloadableImportExport/composer.json
+++ b/app/code/Magento/DownloadableImportExport/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-downloadable-import-export",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-catalog": "101.1.*",
         "magento/module-import-export": "100.2.*",
         "magento/module-catalog-import-export": "100.2.*",
diff --git a/app/code/Magento/Eav/composer.json b/app/code/Magento/Eav/composer.json
index 6fb9fb0cb2cf3cc55edc01232c73284c6919a0a6..16e62a6434a26aa358a3491d697ce7cd3bb54ad7 100644
--- a/app/code/Magento/Eav/composer.json
+++ b/app/code/Magento/Eav/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-eav",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-backend": "100.2.*",
         "magento/module-catalog": "101.1.*",
diff --git a/app/code/Magento/Email/composer.json b/app/code/Magento/Email/composer.json
index 081b94e4a17d182c87d565ed924c74a7d7022889..1b03ad7705cc66310d47125ba87cc5e0f4986cef 100644
--- a/app/code/Magento/Email/composer.json
+++ b/app/code/Magento/Email/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-email",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-theme": "100.2.*",
         "magento/module-config": "100.2.*",
         "magento/module-store": "100.2.*",
diff --git a/app/code/Magento/EncryptionKey/composer.json b/app/code/Magento/EncryptionKey/composer.json
index 5fcb0c936288d98b4393b6411ff0aafc215342bf..6d7ff5558734ab1952b59b2e02db4cc5093f9984 100644
--- a/app/code/Magento/EncryptionKey/composer.json
+++ b/app/code/Magento/EncryptionKey/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-encryption-key",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-config": "100.2.*",
         "magento/module-backend": "100.2.*",
         "magento/framework": "100.2.*"
diff --git a/app/code/Magento/Fedex/composer.json b/app/code/Magento/Fedex/composer.json
index 5934776c81081afb8847b47559db427cef8bfb50..d27d5c1c60d407ce4d1d5b3781b0209c5955a0d4 100644
--- a/app/code/Magento/Fedex/composer.json
+++ b/app/code/Magento/Fedex/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-fedex",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-shipping": "100.2.*",
         "magento/module-directory": "100.2.*",
diff --git a/app/code/Magento/GiftMessage/composer.json b/app/code/Magento/GiftMessage/composer.json
index ace05fc1d084b4aa5e2d49dc7996464a45e3d404..04c620dc36db5829f9c8c6aa8a6aec620d211e95 100644
--- a/app/code/Magento/GiftMessage/composer.json
+++ b/app/code/Magento/GiftMessage/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-gift-message",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-catalog": "101.1.*",
         "magento/module-checkout": "100.2.*",
diff --git a/app/code/Magento/GoogleAdwords/composer.json b/app/code/Magento/GoogleAdwords/composer.json
index 0ec802f83756878704a533ce68680d8eeb58ac96..ad3df5c0b8b2621f395acbfe81bfde3c6b7bae27 100644
--- a/app/code/Magento/GoogleAdwords/composer.json
+++ b/app/code/Magento/GoogleAdwords/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-google-adwords",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-sales": "100.2.*",
         "magento/framework": "100.2.*"
diff --git a/app/code/Magento/GoogleAnalytics/composer.json b/app/code/Magento/GoogleAnalytics/composer.json
index 7fdf4395f3e68e055a29d9020c87c94db584cc69..4cccc7bd0cbff69369ae852138045ed06a0dbf4a 100644
--- a/app/code/Magento/GoogleAnalytics/composer.json
+++ b/app/code/Magento/GoogleAnalytics/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-google-analytics",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-sales": "100.2.*",
         "magento/framework": "100.2.*",
diff --git a/app/code/Magento/GoogleOptimizer/composer.json b/app/code/Magento/GoogleOptimizer/composer.json
index f269aad3dff69346c8580d00444dc7379ddc370c..20a48fc78060b53fb144aa5da405b343ce696063 100644
--- a/app/code/Magento/GoogleOptimizer/composer.json
+++ b/app/code/Magento/GoogleOptimizer/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-google-optimizer",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-google-analytics": "100.2.*",
         "magento/module-catalog": "101.1.*",
diff --git a/app/code/Magento/GroupedImportExport/composer.json b/app/code/Magento/GroupedImportExport/composer.json
index 9af72d5e959cd1af514bf39ab44d8771a14322d0..b036a8d5d528bd3959ea66b294d7b51736f7ba2c 100644
--- a/app/code/Magento/GroupedImportExport/composer.json
+++ b/app/code/Magento/GroupedImportExport/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-grouped-import-export",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-catalog": "101.1.*",
         "magento/module-import-export": "100.2.*",
         "magento/module-catalog-import-export": "100.2.*",
diff --git a/app/code/Magento/GroupedProduct/composer.json b/app/code/Magento/GroupedProduct/composer.json
index 944b45c7d584e6ab584cbf6b093aca089b16054a..69aed214284454722708703068de37e3134393f0 100644
--- a/app/code/Magento/GroupedProduct/composer.json
+++ b/app/code/Magento/GroupedProduct/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-grouped-product",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-catalog": "101.1.*",
         "magento/module-catalog-inventory": "100.2.*",
diff --git a/app/code/Magento/ImportExport/composer.json b/app/code/Magento/ImportExport/composer.json
index 642c653dc9750e2417694420cd5979d96c55cf1a..35a088cbd9c91907c3f9f2c434f16cfb86ed57a8 100644
--- a/app/code/Magento/ImportExport/composer.json
+++ b/app/code/Magento/ImportExport/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-import-export",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-backend": "100.2.*",
         "magento/module-eav": "100.2.*",
diff --git a/app/code/Magento/Indexer/composer.json b/app/code/Magento/Indexer/composer.json
index ffb0a76b34ffe54195abcfd6f358ab7f33fab91e..cbaab12f6ee285ac1207f8c01d5ed5ff5af42c07 100644
--- a/app/code/Magento/Indexer/composer.json
+++ b/app/code/Magento/Indexer/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-indexer",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-backend": "100.2.*",
         "magento/framework": "100.2.*"
     },
diff --git a/app/code/Magento/Integration/composer.json b/app/code/Magento/Integration/composer.json
index 17f0f616a915c95453dab499078b3e8d3d3bd140..028e56472268abc0e0fcc612107a5bd8072da806 100644
--- a/app/code/Magento/Integration/composer.json
+++ b/app/code/Magento/Integration/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-integration",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-backend": "100.2.*",
         "magento/module-customer": "100.2.*",
diff --git a/app/code/Magento/LayeredNavigation/composer.json b/app/code/Magento/LayeredNavigation/composer.json
index 46995fbe03d6eb13581281ba0fab08383296d777..99299c3e4a32cccd465af4131bc549b033142545 100644
--- a/app/code/Magento/LayeredNavigation/composer.json
+++ b/app/code/Magento/LayeredNavigation/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-layered-navigation",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-config": "100.2.*",
         "magento/module-catalog": "101.1.*",
         "magento/framework": "100.2.*"
diff --git a/app/code/Magento/Marketplace/composer.json b/app/code/Magento/Marketplace/composer.json
index 6f2a4cfcb47a9f617d18556a8af34038dc33a8eb..2916ff94544bcc46cd59a9e48e9385e89ea6283b 100644
--- a/app/code/Magento/Marketplace/composer.json
+++ b/app/code/Magento/Marketplace/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-marketplace",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/framework": "100.2.*",
         "magento/module-backend": "100.2.*"
     },
diff --git a/app/code/Magento/MediaStorage/composer.json b/app/code/Magento/MediaStorage/composer.json
index ff180cfbc6804bd04399e7a1165df9e489b4e373..fa7858d5b0aff32de7d37f2756aca1891cb15cf7 100644
--- a/app/code/Magento/MediaStorage/composer.json
+++ b/app/code/Magento/MediaStorage/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-media-storage",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-backend": "100.2.*",
         "magento/module-config": "100.2.*",
diff --git a/app/code/Magento/Msrp/composer.json b/app/code/Magento/Msrp/composer.json
index e1edf0d8a8dded668df4ddb863593757d30ccd92..b86374e6be2779d14fd3d2b3e8a4d5b46b1b881f 100644
--- a/app/code/Magento/Msrp/composer.json
+++ b/app/code/Magento/Msrp/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-msrp",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-catalog": "101.1.*",
         "magento/module-downloadable": "100.2.*",
diff --git a/app/code/Magento/Multishipping/composer.json b/app/code/Magento/Multishipping/composer.json
index b97ebd181de740c13edbfbee7d6a0daebd8bdc95..8d9ac91cd05a07b78c19588cbcd34ce3a110cc9f 100644
--- a/app/code/Magento/Multishipping/composer.json
+++ b/app/code/Magento/Multishipping/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-multishipping",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-checkout": "100.2.*",
         "magento/module-sales": "100.2.*",
diff --git a/app/code/Magento/NewRelicReporting/composer.json b/app/code/Magento/NewRelicReporting/composer.json
index 9673353984d0a53ec43ddbe1ac57219e959aed8f..9faa17d454e5072f7dc9ec5473057bfad1533dce 100644
--- a/app/code/Magento/NewRelicReporting/composer.json
+++ b/app/code/Magento/NewRelicReporting/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-new-relic-reporting",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-backend": "100.2.*",
         "magento/module-customer": "100.2.*",
diff --git a/app/code/Magento/Newsletter/composer.json b/app/code/Magento/Newsletter/composer.json
index a206b86fc37aef9cbe49531a24ff4362eef87899..d6746f48dcbe54b44a15723b9a144f9cf77447c7 100644
--- a/app/code/Magento/Newsletter/composer.json
+++ b/app/code/Magento/Newsletter/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-newsletter",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-customer": "100.2.*",
         "magento/module-widget": "100.2.*",
diff --git a/app/code/Magento/OfflinePayments/composer.json b/app/code/Magento/OfflinePayments/composer.json
index 707e657004e3d3a79cd82f109394ca74b4766cca..52deb08ba3d904a824faa762391ddf67ae29b026 100644
--- a/app/code/Magento/OfflinePayments/composer.json
+++ b/app/code/Magento/OfflinePayments/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-offline-payments",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-checkout": "100.2.*",
         "magento/module-payment": "100.2.*",
         "magento/framework": "100.2.*"
diff --git a/app/code/Magento/OfflineShipping/composer.json b/app/code/Magento/OfflineShipping/composer.json
index 69d3f7b1eb0534b622c9f2bc3becfee9ba564044..e9a759057d322074de433b3460162c3a883f3ebf 100644
--- a/app/code/Magento/OfflineShipping/composer.json
+++ b/app/code/Magento/OfflineShipping/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-offline-shipping",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-config": "100.2.*",
         "magento/module-store": "100.2.*",
         "magento/module-backend": "100.2.*",
diff --git a/app/code/Magento/PageCache/composer.json b/app/code/Magento/PageCache/composer.json
index 6eaf0c9731202678d387040594c017e41aa1b425..5c29e4fc3c97081626ae4a77243ccd6ac9843d38 100644
--- a/app/code/Magento/PageCache/composer.json
+++ b/app/code/Magento/PageCache/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-page-cache",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-config": "100.2.*",
         "magento/module-store": "100.2.*",
         "magento/module-backend": "100.2.*",
diff --git a/app/code/Magento/Payment/Model/MethodList.php b/app/code/Magento/Payment/Model/MethodList.php
index df0ddb9ed4b0c5490db8813f028998f2d69e6a4f..d547fe42f332ca4c49f0ff51ac16c0b59e538556 100644
--- a/app/code/Magento/Payment/Model/MethodList.php
+++ b/app/code/Magento/Payment/Model/MethodList.php
@@ -61,6 +61,7 @@ class MethodList
     {
         return $this->methodSpecificationFactory->create(
             [
+                AbstractMethod::CHECK_USE_CHECKOUT,
                 AbstractMethod::CHECK_USE_FOR_COUNTRY,
                 AbstractMethod::CHECK_USE_FOR_CURRENCY,
                 AbstractMethod::CHECK_ORDER_TOTAL_MIN_MAX,
diff --git a/app/code/Magento/Payment/Test/Unit/Model/MethodListTest.php b/app/code/Magento/Payment/Test/Unit/Model/MethodListTest.php
index b1e5bedb5a250e4daf48d8107eb421c305397d69..241f3fc4fcf532ff283d0a2afcdee833beb6e211 100644
--- a/app/code/Magento/Payment/Test/Unit/Model/MethodListTest.php
+++ b/app/code/Magento/Payment/Test/Unit/Model/MethodListTest.php
@@ -8,8 +8,8 @@
 
 namespace Magento\Payment\Test\Unit\Model;
 
-use Magento\Payment\Model\Method\Free;
-use \Magento\Payment\Model\MethodList;
+use Magento\Payment\Model\MethodList;
+use Magento\Payment\Model\Method\AbstractMethod;
 
 class MethodListTest extends \PHPUnit_Framework_TestCase
 {
@@ -68,6 +68,12 @@ class MethodListTest extends \PHPUnit_Framework_TestCase
 
         $this->specificationFactoryMock->expects($this->atLeastOnce())
             ->method('create')
+            ->with([
+                AbstractMethod::CHECK_USE_CHECKOUT,
+                AbstractMethod::CHECK_USE_FOR_COUNTRY,
+                AbstractMethod::CHECK_USE_FOR_CURRENCY,
+                AbstractMethod::CHECK_ORDER_TOTAL_MIN_MAX
+            ])
             ->will($this->returnValue($compositeMock));
 
         $storeMethods = [$methodMock];
diff --git a/app/code/Magento/Payment/composer.json b/app/code/Magento/Payment/composer.json
index a156849e243131bc4c93c58d6fdefac8b85215c5..35ff326d916bd43f8ae2366d9b50f5b77fe46dc8 100644
--- a/app/code/Magento/Payment/composer.json
+++ b/app/code/Magento/Payment/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-payment",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-config": "100.2.*",
         "magento/module-store": "100.2.*",
         "magento/module-sales": "100.2.*",
diff --git a/app/code/Magento/Paypal/Setup/InstallSchema.php b/app/code/Magento/Paypal/Setup/InstallSchema.php
index d55782be8627915e7458874c5e6cc9fddd60224c..d0a07242ad75e03b334d7d23f289e7e9847546bd 100644
--- a/app/code/Magento/Paypal/Setup/InstallSchema.php
+++ b/app/code/Magento/Paypal/Setup/InstallSchema.php
@@ -165,7 +165,7 @@ class InstallSchema implements InstallSchemaInterface
             'Report Id'
         )->addColumn(
             'report_date',
-            \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP,
+            \Magento\Framework\DB\Ddl\Table::TYPE_DATE,
             null,
             [],
             'Report Date'
diff --git a/app/code/Magento/Paypal/composer.json b/app/code/Magento/Paypal/composer.json
index b0bdb0d62f03ec8e10d68fd0e1379815bfc5db64..bddc5d91a94587f4d26532246d8c83f8de6ba7f7 100644
--- a/app/code/Magento/Paypal/composer.json
+++ b/app/code/Magento/Paypal/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-paypal",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-config": "100.2.*",
         "magento/module-store": "100.2.*",
         "magento/module-checkout": "100.2.*",
diff --git a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_ca.xml b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_ca.xml
index fb2b7456fb7c591431fd89af3b8973110d4c8eca..fc0ca6ebb6e9da5170061678910a1ac620d7fc03 100644
--- a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_ca.xml
+++ b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_ca.xml
@@ -143,9 +143,13 @@
             <rule type="paypalExpressDisable" event="activate-rule"/>
             <rule type="paypalExpressLockConfiguration" event="activate-rule"/>
             <rule type="paypalExpressMarkDisable" event="deactivate-rule">
+                <argument name="wpp_ca">wpp_ca</argument>
+                <argument name="paypal_payflowpro_ca">paypal_payflowpro_ca</argument>
                 <argument name="payflow_link_ca">payflow_link_ca</argument>
             </rule>
             <rule type="paypalExpressUnlockConfiguration" event="deactivate-rule">
+                <argument name="wpp_ca">wpp_ca</argument>
+                <argument name="paypal_payflowpro_ca">paypal_payflowpro_ca</argument>
                 <argument name="payflow_link_ca">payflow_link_ca</argument>
             </rule>
         </relation>
diff --git a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_us.xml b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_us.xml
index dfbb68283daa971c0db56b80252816bdc3b919c3..554b459d3c45a0db6cfe4c11bba36528ae4361d5 100644
--- a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_us.xml
+++ b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_us.xml
@@ -351,6 +351,7 @@
             <rule type="payflowExpressEnable" event="activate-rule"/>
             <rule type="payflowBmlEnable" event="activate-rule"/>
             <rule type="payflowShowSortOrder" event="activate-rule"/>
+            <rule type="payflowShowSortOrder" event="activate-express"/>
             <rule type="simpleDisable" event="deactivate-rule"/>
             <rule type="payflowExpressEnableConditional" event="deactivate-rule">
                 <argument name="payflow_advanced">payflow_advanced</argument>
@@ -363,6 +364,7 @@
                 <argument name="paypal_payflowpro_with_express_checkout">paypal_payflowpro_with_express_checkout</argument>
             </rule>
             <rule type="payflowHideSortOrder" event="deactivate-rule"/>
+            <rule type="payflowHideSortOrder" event="deactivate-express"/>
             <rule type="payflowBmlDisableConditionalExpress" event="deactivate-express"/>
             <rule type="payflowBmlDisableConditionalExpress" event=":load"/>
             <rule type="payflowBmlEnable" event="activate-express"/>
diff --git a/app/code/Magento/Persistent/composer.json b/app/code/Magento/Persistent/composer.json
index d165344851ab24e87b210be8bd6ca43b1a536d3f..25cc9d76acd768fe970363628abad60945e418d9 100644
--- a/app/code/Magento/Persistent/composer.json
+++ b/app/code/Magento/Persistent/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-persistent",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-checkout": "100.2.*",
         "magento/module-customer": "100.2.*",
diff --git a/app/code/Magento/ProductAlert/composer.json b/app/code/Magento/ProductAlert/composer.json
index 6e143b5fb7e5948441e6d65b9a64d9f36bfd499a..a43a52209740318e0f5adcc8bea03a8860c04037 100644
--- a/app/code/Magento/ProductAlert/composer.json
+++ b/app/code/Magento/ProductAlert/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-product-alert",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-backend": "100.2.*",
         "magento/module-store": "100.2.*",
         "magento/module-catalog": "101.1.*",
diff --git a/app/code/Magento/ProductVideo/composer.json b/app/code/Magento/ProductVideo/composer.json
index 3ba8aef446d0caeea0775e0443723e24b374b8c0..362fd006d2690c9f9b60b7be3abb71d5ce0b4da7 100644
--- a/app/code/Magento/ProductVideo/composer.json
+++ b/app/code/Magento/ProductVideo/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-product-video",
     "description": "Add Video to Products",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-catalog": "101.1.*",
         "magento/module-backend": "100.2.*",
         "magento/module-eav": "100.2.*",
diff --git a/app/code/Magento/Quote/composer.json b/app/code/Magento/Quote/composer.json
index bab6a636b5b5bc0d727fb8f540548ed818890e4e..3d6fb04674bba5da6713a55dbc7ac448bf0c89e9 100644
--- a/app/code/Magento/Quote/composer.json
+++ b/app/code/Magento/Quote/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-quote",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-catalog": "101.1.*",
         "magento/module-customer": "100.2.*",
diff --git a/app/code/Magento/Reports/composer.json b/app/code/Magento/Reports/composer.json
index f6687eba4e68bc30b3618d7be0945f57f1eec734..0bb989cb54ac8cb84e3da943a231634b6707f256 100644
--- a/app/code/Magento/Reports/composer.json
+++ b/app/code/Magento/Reports/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-reports",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-config": "100.2.*",
         "magento/module-store": "100.2.*",
         "magento/module-eav": "100.2.*",
diff --git a/app/code/Magento/RequireJs/composer.json b/app/code/Magento/RequireJs/composer.json
index 7948aeecebb057cc47052a9915a8ce298dbca812..8c9fed33ab730dd2431b222b2edd04aa2252e12f 100644
--- a/app/code/Magento/RequireJs/composer.json
+++ b/app/code/Magento/RequireJs/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-require-js",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/framework": "100.2.*"
     },
     "type": "magento2-module",
diff --git a/app/code/Magento/Review/composer.json b/app/code/Magento/Review/composer.json
index 29eb5cf1e568f7bfe07614d0d029d47c44446af7..09f5529feabdd97512839be2dacd00f791083c3c 100644
--- a/app/code/Magento/Review/composer.json
+++ b/app/code/Magento/Review/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-review",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-catalog": "101.1.*",
         "magento/module-customer": "100.2.*",
diff --git a/app/code/Magento/Rss/composer.json b/app/code/Magento/Rss/composer.json
index 29731136602bd74973753787e15546580595c072..d35f0ee6ebecbf75af87566d776f172ab3d22c0d 100644
--- a/app/code/Magento/Rss/composer.json
+++ b/app/code/Magento/Rss/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-rss",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-backend": "100.2.*",
         "magento/framework": "100.2.*",
diff --git a/app/code/Magento/Rule/composer.json b/app/code/Magento/Rule/composer.json
index a4bc7c0d3c7adc9bdac4daa4489eb8c289a2aaff..95b8e6ffec2a682895b3459ca7bdcc7b4f001669 100644
--- a/app/code/Magento/Rule/composer.json
+++ b/app/code/Magento/Rule/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-rule",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-eav": "100.2.*",
         "magento/module-catalog": "101.1.*",
diff --git a/app/code/Magento/Sales/composer.json b/app/code/Magento/Sales/composer.json
index d6e19280565f87d5a1d03db4b3b2081a48f4b9a5..09d1a9d6b7dd41ea95a09b26c0f72276327fe245 100644
--- a/app/code/Magento/Sales/composer.json
+++ b/app/code/Magento/Sales/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-sales",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-catalog": "101.1.*",
         "magento/module-customer": "100.2.*",
diff --git a/app/code/Magento/SalesRule/composer.json b/app/code/Magento/SalesRule/composer.json
index 80a0802f2f557199c7f5ce2116cc72bccfb03407..fabef581762a84cac8844bf7e7099b0bb8b6b6c0 100644
--- a/app/code/Magento/SalesRule/composer.json
+++ b/app/code/Magento/SalesRule/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-sales-rule",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-config": "100.2.*",
         "magento/module-store": "100.2.*",
         "magento/module-rule": "100.2.*",
diff --git a/app/code/Magento/SalesSequence/composer.json b/app/code/Magento/SalesSequence/composer.json
index 5689a019806d23984af8e95a8caa4ce46da61506..eeda2be05e68f86cb5552e6f48ca502dd96cb9be 100644
--- a/app/code/Magento/SalesSequence/composer.json
+++ b/app/code/Magento/SalesSequence/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-sales-sequence",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/framework": "100.2.*"
     },
     "type": "magento2-module",
diff --git a/app/code/Magento/SampleData/composer.json b/app/code/Magento/SampleData/composer.json
index 3fda6ff798d6964e9b2bba22e0da2a13f9b5fc89..936bbf0d6be3a7399babc2e835282e7c71bea4c2 100644
--- a/app/code/Magento/SampleData/composer.json
+++ b/app/code/Magento/SampleData/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-sample-data",
     "description": "Sample Data fixtures",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/framework": "100.2.*"
     },
     "suggest": {
diff --git a/app/code/Magento/Search/composer.json b/app/code/Magento/Search/composer.json
index a4c1fa890239086b6f2275a0cb9da8b1c03e0538..cc95e6784526f33bb65246b599a4147e8a1afa1d 100644
--- a/app/code/Magento/Search/composer.json
+++ b/app/code/Magento/Search/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-search",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/framework": "100.2.*",
         "magento/module-backend": "100.2.*",
         "magento/module-catalog-search": "100.2.*",
diff --git a/app/code/Magento/Security/composer.json b/app/code/Magento/Security/composer.json
index fd2feb9e50f2a5d1e44852c39d60850980bcba01..f64c0f0b29d282b0feaefb24ebb3963086f0e083 100644
--- a/app/code/Magento/Security/composer.json
+++ b/app/code/Magento/Security/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-security",
     "description": "Security management module",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-backend": "100.2.*",
         "magento/module-store": "100.2.*",
         "magento/framework": "100.2.*"
diff --git a/app/code/Magento/SendFriend/composer.json b/app/code/Magento/SendFriend/composer.json
index a18523b95b4560451b5a3f8d93817e73dc6d1190..de9dbf7a84576022d8f6b1a38324f902565870df 100644
--- a/app/code/Magento/SendFriend/composer.json
+++ b/app/code/Magento/SendFriend/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-send-friend",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-catalog": "101.1.*",
         "magento/module-customer": "100.2.*",
diff --git a/app/code/Magento/Shipping/composer.json b/app/code/Magento/Shipping/composer.json
index de12c13c7cab0b5a10404040abf242fb98fd08f5..dc9ea808c0f7b19e396a7c73f2b416221729a34b 100644
--- a/app/code/Magento/Shipping/composer.json
+++ b/app/code/Magento/Shipping/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-shipping",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-catalog": "101.1.*",
         "magento/module-sales": "100.2.*",
diff --git a/app/code/Magento/Shipping/view/adminhtml/web/order/packaging.js b/app/code/Magento/Shipping/view/adminhtml/web/order/packaging.js
index 2ad2ff596a7077f92c91623fef98d374449480b1..b3a7ea2e2495657efcf2de1fcfc5a00eb8939f7b 100644
--- a/app/code/Magento/Shipping/view/adminhtml/web/order/packaging.js
+++ b/app/code/Magento/Shipping/view/adminhtml/web/order/packaging.js
@@ -353,7 +353,7 @@ Packaging.prototype = {
                     var response = transport.responseText;
                     if (response) {
                         packagePrapareGrid.update(response);
-                        this._processPackagePrapare(packagePrapareGrid);
+                        this.processPackagePrepare(packagePrapareGrid);
                         if (packagePrapareGrid.select('.grid tbody tr').length) {
                             packageBlock.select('[data-action=package-add-items]')[0].hide();
                             packageBlock.select('[data-action=package-save-items]')[0].show();
@@ -692,22 +692,27 @@ Packaging.prototype = {
         }
     },
 
-    _processPackagePrapare: function(packagePrapare) {
-        var itemsAll = [];
-        packagePrapare.select('.grid tbody tr').each(function(item) {
-            var qty  = item.select('[name="qty"]')[0];
-            var itemId = item.select('[type="checkbox"]')[0].value;
-            var qtyValue = 0;
+    processPackagePrepare: function(packagePrepare) {
+        var itemsAll = [],
+            qty,
+            itemId,
+            qtyValue = 0,
+            value = 1;
+
+        packagePrepare.select('.grid tbody tr').each(function(item) {
+            qty = item.select('[name="qty"]')[0],
+                itemId = item.select('[type="checkbox"]')[0].value,
+                qtyValue = parseFloat(qty.value);
+
             if (Object.isFunction(this.itemQtyCallback)) {
-                var value = this.itemQtyCallback(itemId);
-                qtyValue = ((typeof value == 'string') && (value.length == 0)) ? 0 : parseFloat(value);
-                if (isNaN(qtyValue) || qtyValue < 0) {
-                    qtyValue = 1;
+                value = this.itemQtyCallback(itemId);
+                if (typeof value !== 'undefined') {
+                    qtyValue = parseFloat(value);
+                    qtyValue = this.validateItemQty(itemId, qtyValue);
+                    qty.value = qtyValue;
                 }
-                qtyValue = this.validateItemQty(itemId, qtyValue);
-                qty.value = qtyValue;
             } else {
-                var value = item.select('[name="qty"]')[0].value;
+                value = item.select('[name="qty"]')[0].value;
                 qtyValue = ((typeof value == 'string') && (value.length == 0)) ? 0 : parseFloat(value);
                 if (isNaN(qtyValue) || qtyValue < 0) {
                     qtyValue = 1;
@@ -737,10 +742,10 @@ Packaging.prototype = {
             this.itemsAll = itemsAll;
         }
 
-        packagePrapare.select('tbody input[type="checkbox"]').each(function(item){
+        packagePrepare.select('tbody input[type="checkbox"]').each(function(item){
             $(item).observe('change', this._observeQty);
             this._observeQty.call(item);
-        }.bind(this))
+        }.bind(this));
     },
 
     _observeQty: function() {
diff --git a/app/code/Magento/Sitemap/composer.json b/app/code/Magento/Sitemap/composer.json
index 419d95a07159eb89533f0367289c868b1a7c7d04..be553a4da194f4dbf64fb4237fd92bb27e4e17ff 100644
--- a/app/code/Magento/Sitemap/composer.json
+++ b/app/code/Magento/Sitemap/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-sitemap",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-catalog": "101.1.*",
         "magento/module-eav": "100.2.*",
diff --git a/app/code/Magento/Store/composer.json b/app/code/Magento/Store/composer.json
index 50d54966a9b4c5143e46d1a87de7fb9a9246a415..b9f76f6c2c3137aa21d8f4a6cf97880fdc3e72f6 100644
--- a/app/code/Magento/Store/composer.json
+++ b/app/code/Magento/Store/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-store",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-catalog": "101.1.*",
         "magento/module-directory": "100.2.*",
         "magento/module-ui": "100.2.*",
diff --git a/app/code/Magento/Swagger/composer.json b/app/code/Magento/Swagger/composer.json
index f30fa606c6d777d6a56a003f57455dff6cb68533..dc2d1cbee003de647cf72f7312ad7f7fcc222e3b 100644
--- a/app/code/Magento/Swagger/composer.json
+++ b/app/code/Magento/Swagger/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-swagger",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/framework": "100.2.*"
     },
     "type": "magento2-module",
diff --git a/app/code/Magento/Swatches/composer.json b/app/code/Magento/Swatches/composer.json
index db3da5c4f27f4c30a33b649f945dfd904cadbfb4..f87fdb635cb73386b40fec6ac932eaee3f9cd398 100644
--- a/app/code/Magento/Swatches/composer.json
+++ b/app/code/Magento/Swatches/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-swatches",
     "description": "Add Swatches to Products",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-catalog": "101.1.*",
         "magento/module-configurable-product": "100.2.*",
         "magento/module-eav": "100.2.*",
diff --git a/app/code/Magento/SwatchesLayeredNavigation/composer.json b/app/code/Magento/SwatchesLayeredNavigation/composer.json
index f8d7fac97dc132e20adcb3c6adb050ea73eb9b66..9b658d0a42e61e0b556f1aa5aed6e12ed8cfdbe7 100644
--- a/app/code/Magento/SwatchesLayeredNavigation/composer.json
+++ b/app/code/Magento/SwatchesLayeredNavigation/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-swatches-layered-navigation",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/framework": "100.2.*",
         "magento/magento-composer-installer": "*"
     },
diff --git a/app/code/Magento/Tax/composer.json b/app/code/Magento/Tax/composer.json
index 9063d4f0395543b0c22647177f1b6f786c07b0e6..4553fdbb383323732b667df9be3e140aca011744 100644
--- a/app/code/Magento/Tax/composer.json
+++ b/app/code/Magento/Tax/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-tax",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-config": "100.2.*",
         "magento/module-store": "100.2.*",
         "magento/module-catalog": "101.1.*",
diff --git a/app/code/Magento/TaxImportExport/composer.json b/app/code/Magento/TaxImportExport/composer.json
index faa66cbaaf906f64dfb4bc6042ca0e4472e3c7ad..c3d09e4926e02d67a98c0e15c050d67997ae1ecd 100644
--- a/app/code/Magento/TaxImportExport/composer.json
+++ b/app/code/Magento/TaxImportExport/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-tax-import-export",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-tax": "100.2.*",
         "magento/module-backend": "100.2.*",
         "magento/module-directory": "100.2.*",
diff --git a/app/code/Magento/Theme/composer.json b/app/code/Magento/Theme/composer.json
index dad8bac7c254b292c34538a6b7f890500e1d4f87..49382f9642fa5d2b88d7d2f4cea79c07d5306cb1 100644
--- a/app/code/Magento/Theme/composer.json
+++ b/app/code/Magento/Theme/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-theme",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-customer": "100.2.*",
         "magento/module-backend": "100.2.*",
diff --git a/app/code/Magento/Translation/composer.json b/app/code/Magento/Translation/composer.json
index 67a0582986f68c1ef3af8f474a7606023c3d0e9f..9ea00544d805094927499672f98fb72ad12ae97a 100644
--- a/app/code/Magento/Translation/composer.json
+++ b/app/code/Magento/Translation/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-translation",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-backend": "100.2.*",
         "magento/module-developer": "100.2.*",
         "magento/module-store": "100.2.*",
diff --git a/app/code/Magento/Ui/Component/Filters/Type/Date.php b/app/code/Magento/Ui/Component/Filters/Type/Date.php
index f670f826e4e20965c1312db80d14f4e9c52e7e09..f5d392ea5136565797ae7306b870c07399043d68 100644
--- a/app/code/Magento/Ui/Component/Filters/Type/Date.php
+++ b/app/code/Magento/Ui/Component/Filters/Type/Date.php
@@ -23,6 +23,13 @@ class Date extends AbstractFilter
      */
     protected $wrappedComponent;
 
+    /**
+     * Date format
+     *
+     * @var string
+     */
+    protected static $dateFormat = 'Y-m-d H:i:s';
+
     /**
      * Prepare component configuration
      *
@@ -96,7 +103,7 @@ class Date extends AbstractFilter
         if (!empty($value)) {
             $filter = $this->filterBuilder->setConditionType($type)
                 ->setField($this->getName())
-                ->setValue($value->format('Y-m-d H:i:s'))
+                ->setValue($value->format(static::$dateFormat))
                 ->create();
 
             $this->getContext()->getDataProvider()->addFilter($filter);
diff --git a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php
index 7000d9e091139a08199a6d23059f4bcd3220ff21..af53b71f18414f8c0f16f27e32b13ba354d29567 100644
--- a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php
+++ b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php
@@ -5,9 +5,11 @@
  */
 namespace Magento\Ui\Test\Unit\Component\Filters\Type;
 
-use Magento\Framework\View\Element\UiComponent\ContextInterface as UiContext;
+use Magento\Framework\Api\Filter;
+use Magento\Framework\Api\FilterBuilder;
 use Magento\Framework\View\Element\UiComponent\DataProvider\DataProviderInterface;
 use Magento\Framework\View\Element\UiComponentFactory;
+use Magento\Ui\Component\Filters\FilterModifier;
 use Magento\Ui\Component\Filters\Type\Date;
 use Magento\Framework\View\Element\UiComponent\ContextInterface;
 use Magento\Ui\Component\Form\Element\DataType\Date as FormDate;
@@ -20,61 +22,55 @@ class DateTest extends \PHPUnit_Framework_TestCase
     /**
      * @var ContextInterface|\PHPUnit_Framework_MockObject_MockObject
      */
-    protected $contextMock;
+    private $contextMock;
 
     /**
      * @var UiComponentFactory|\PHPUnit_Framework_MockObject_MockObject
      */
-    protected $uiComponentFactory;
+    private $uiComponentFactory;
 
     /**
-     * @var \Magento\Framework\Api\FilterBuilder|\PHPUnit_Framework_MockObject_MockObject
+     * @var FilterBuilder|\PHPUnit_Framework_MockObject_MockObject
      */
-    protected $filterBuilderMock;
+    private $filterBuilderMock;
 
     /**
-     * @var \Magento\Ui\Component\Filters\FilterModifier|\PHPUnit_Framework_MockObject_MockObject
+     * @var FilterModifier|\PHPUnit_Framework_MockObject_MockObject
      */
-    protected $filterModifierMock;
+    private $filterModifierMock;
+
+
+    /**
+     * @var DataProviderInterface|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private $dataProviderMock;
 
     /**
      * Set up
      */
     protected function setUp()
     {
-        $this->contextMock = $this->getMockForAbstractClass(
-            'Magento\Framework\View\Element\UiComponent\ContextInterface',
-            [],
-            '',
-            false
-        );
-        $processor = $this->getMockBuilder('Magento\Framework\View\Element\UiComponent\Processor')
+        $this->contextMock = $this->getMockForAbstractClass(ContextInterface::class);
+        $processor = $this->getMockBuilder(\Magento\Framework\View\Element\UiComponent\Processor::class)
+            ->disableOriginalConstructor()
+            ->getMock();
+        $this->contextMock->expects(static::any())
+            ->method('getProcessor')
+            ->willReturn($processor);
+        $this->uiComponentFactory = $this->getMockBuilder(UiComponentFactory::class)
+            ->setMethods(['create'])
+            ->disableOriginalConstructor()
+            ->getMock();
+        $this->filterBuilderMock = $this->getMockBuilder(FilterBuilder::class)
             ->disableOriginalConstructor()
             ->getMock();
-        $this->contextMock->expects($this->any())->method('getProcessor')->willReturn($processor);
-        $this->uiComponentFactory = $this->getMock(
-            'Magento\Framework\View\Element\UiComponentFactory',
-            ['create'],
-            [],
-            '',
-            false
-        );
-        $this->filterBuilderMock = $this->getMock(
-            'Magento\Framework\Api\FilterBuilder',
-            [],
-            [],
-            '',
-            false
-        );
-
-        $this->filterModifierMock = $this->getMock(
-            'Magento\Ui\Component\Filters\FilterModifier',
-            ['applyFilterModifier'],
-            [],
-            '',
-            false
-        );
 
+        $this->filterModifierMock = $this->getMockBuilder(FilterModifier::class)
+            ->setMethods(['applyFilterModifier'])
+            ->disableOriginalConstructor()
+            ->getMock();
+        
+        $this->dataProviderMock = $this->getMockForAbstractClass(DataProviderInterface::class);
     }
 
     /**
@@ -92,7 +88,7 @@ class DateTest extends \PHPUnit_Framework_TestCase
             []
         );
 
-        $this->assertTrue($date->getComponentName() === Date::NAME);
+        static::assertTrue($date->getComponentName() === Date::NAME);
     }
 
     /**
@@ -107,13 +103,9 @@ class DateTest extends \PHPUnit_Framework_TestCase
     public function testPrepare($name, $filterData, $expectedCondition)
     {
         /** @var FormDate $uiComponent */
-        $uiComponent = $this->getMock(
-            'Magento\Ui\Component\Form\Element\DataType\Date',
-            [],
-            [],
-            '',
-            false
-        );
+        $uiComponent = $this->getMockBuilder(FormDate::class)
+            ->disableOriginalConstructor()
+            ->getMock();
 
         $uiComponent->expects($this->any())
             ->method('getContext')
@@ -125,30 +117,62 @@ class DateTest extends \PHPUnit_Framework_TestCase
         $this->contextMock->expects($this->any())
             ->method('addComponentDefinition')
             ->with(Date::NAME, ['extends' => Date::NAME]);
+
         $this->contextMock->expects($this->any())
-            ->method('getRequestParam')
-            ->with(UiContext::FILTER_VAR)
+            ->method('getFiltersParams')
             ->willReturn($filterData);
-        $dataProvider = $this->getMockForAbstractClass(
-            'Magento\Framework\View\Element\UiComponent\DataProvider\DataProviderInterface',
-            [],
-            '',
-            false
-        );
+        
         $this->contextMock->expects($this->any())
             ->method('getDataProvider')
-            ->willReturn($dataProvider);
+            ->willReturn($this->dataProviderMock);
+
         if ($expectedCondition !== null) {
-            $dataProvider->expects($this->any())
-                ->method('addFilter')
-                ->with($expectedCondition, $name);
-
-            $uiComponent->expects($this->any())
-                ->method('getLocale')
-                ->willReturn($expectedCondition['locale']);
-            $uiComponent->expects($this->any())
-                ->method('convertDate')
-                ->willReturnArgument(0);
+            if (is_string($filterData[$name])) {
+                $uiComponent->expects(static::once())
+                    ->method('convertDate')
+                    ->with($filterData[$name])
+                    ->willReturn(new \DateTime($filterData[$name]));
+            } else {
+                $uiComponent->method('convertDate')
+                    ->willReturnMap([
+                        [$filterData[$name]['from'], 0, 0, 0, new \DateTime($filterData[$name]['from'])],
+                        [$filterData[$name]['to'], 23, 59, 59, new \DateTime($filterData[$name]['to'] . ' 23:59:59')],
+                    ]);
+            }
+
+            $i=0;
+            switch (true) {
+                case is_string($filterData[$name]):
+                case isset($filterData[$name]['from']) && !isset($filterData[$name]['to']):
+                case !isset($filterData[$name]['from']) && isset($filterData[$name]['to']):
+                    $filterMock = $this->getFilterMock(
+                        $name,
+                        $expectedCondition['type'],
+                        $expectedCondition['date'],
+                        $i
+                    );
+                    $this->dataProviderMock->expects(static::once())
+                        ->method('addFilter')
+                        ->with($filterMock);
+                    break;
+                case isset($filterData[$name]['from']) && isset($filterData[$name]['to']):
+                    $this->getFilterMock(
+                        $name,
+                        $expectedCondition['type_from'],
+                        $expectedCondition['date_from'],
+                        $i
+                    );
+                    $filterMock = $this->getFilterMock(
+                        $name,
+                        $expectedCondition['type_to'],
+                        $expectedCondition['date_to'],
+                        $i
+                    );
+                    $this->dataProviderMock->expects(static::exactly(2))
+                        ->method('addFilter')
+                        ->with($filterMock);
+                    break;
+            }
         }
 
         $this->uiComponentFactory->expects($this->any())
@@ -167,6 +191,39 @@ class DateTest extends \PHPUnit_Framework_TestCase
         $date->prepare();
     }
 
+    /**
+     * Gets Filter mock
+     * 
+     * @param string $name
+     * @param string $expectedType
+     * @param string $expectedDate
+     * @param int $i
+     * 
+     * @return Filter|\PHPUnit_Framework_MockObject_MockObject
+     */
+    private function getFilterMock($name, $expectedType, $expectedDate, &$i)
+    {
+        $this->filterBuilderMock->expects(static::at($i++))
+            ->method('setConditionType')
+            ->with($expectedType)
+            ->willReturnSelf();
+        $this->filterBuilderMock->expects(static::at($i++))
+            ->method('setField')
+            ->with($name)
+            ->willReturnSelf();
+        $this->filterBuilderMock->expects(static::at($i++))
+            ->method('setValue')
+            ->with($expectedDate)
+            ->willReturnSelf();
+        
+        $filterMock = $this->getMock(Filter::class);
+        $this->filterBuilderMock->expects(static::at($i++))
+            ->method('create')
+            ->willReturn($filterMock);
+
+        return $filterMock;
+    }
+
     /**
      * @return array
      */
@@ -175,26 +232,27 @@ class DateTest extends \PHPUnit_Framework_TestCase
         return [
             [
                 'test_date',
-                ['test_date' => ['from' => '11-05-2015', 'to' => '']],
-                ['from' => '11-05-2015', 'orig_from' => '11-05-2015', 'datetime' => true, 'locale' => 'en_US'],
+                ['test_date' => ['from' => '11-05-2015', 'to' => null]],
+                ['date' => '2015-05-11 00:00:00', 'type' => 'gteq'],
             ],
             [
                 'test_date',
-                ['test_date' => ['from' => '', 'to' => '11-05-2015']],
-                ['to' => '11-05-2015', 'orig_to' => '11-05-2015', 'datetime' => true, 'locale' => 'en_US'],
+                ['test_date' => ['from' => null, 'to' => '11-05-2015']],
+                ['date' => '2015-05-11 23:59:59', 'type' => 'lteq'],
             ],
             [
                 'test_date',
-                ['test_date' => ['from' => '10-05-2015', 'to' => '11-05-2015']],
+                ['test_date' => ['from' => '11-05-2015', 'to' => '11-05-2015']],
                 [
-                    'from' => '10-05-2015',
-                    'orig_from' => '10-05-2015',
-                    'to' => '11-05-2015',
-                    'orig_to' => '11-05-2015',
-                    'datetime' => true,
-                    'locale' => 'en_US'
+                    'date_from' => '2015-05-11 00:00:00', 'type_from' => 'gteq',
+                    'date_to' => '2015-05-11 23:59:59', 'type_to' => 'lteq'
                 ],
             ],
+            [
+                'test_date',
+                ['test_date' => '11-05-2015'],
+                ['date' => '2015-05-11 00:00:00', 'type' => 'eq'],
+            ],
             [
                 'test_date',
                 ['test_date' => ['from' => '', 'to' => '']],
diff --git a/app/code/Magento/Ui/composer.json b/app/code/Magento/Ui/composer.json
index cea9711ddda7b0b059e2724681bcc077ac6a693b..43c7b7fa3011fd7c6386fcde17eb45b6c5e02695 100644
--- a/app/code/Magento/Ui/composer.json
+++ b/app/code/Magento/Ui/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-ui",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-backend": "100.2.*",
         "magento/framework": "100.2.*",
         "magento/module-eav": "100.2.*",
diff --git a/app/code/Magento/Ups/composer.json b/app/code/Magento/Ups/composer.json
index 1ddbfa2a0cb9f07e70f6278c7884043afff28cbd..ade4e738a68efe0499041830892bb6b61f5a3156 100644
--- a/app/code/Magento/Ups/composer.json
+++ b/app/code/Magento/Ups/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-ups",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-backend": "100.2.*",
         "magento/module-sales": "100.2.*",
diff --git a/app/code/Magento/UrlRewrite/composer.json b/app/code/Magento/UrlRewrite/composer.json
index 87e4f357f4abd631ed6bdab0ac63e4eae1015259..ac75ecdf61b8fd0531f2b14f76d2aec7d72581be 100644
--- a/app/code/Magento/UrlRewrite/composer.json
+++ b/app/code/Magento/UrlRewrite/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-url-rewrite",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-catalog": "101.1.*",
         "magento/module-store": "100.2.*",
         "magento/framework": "100.2.*",
diff --git a/app/code/Magento/User/composer.json b/app/code/Magento/User/composer.json
index 4cdf24ff7513df294d1d31506097f0f385122767..755c47ac1147612e1e55b589e72afa705b39b0ce 100644
--- a/app/code/Magento/User/composer.json
+++ b/app/code/Magento/User/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-user",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-authorization": "100.2.*",
         "magento/module-backend": "100.2.*",
diff --git a/app/code/Magento/Usps/composer.json b/app/code/Magento/Usps/composer.json
index d9e575675841cd308f60398d9af12d0c2047b079..5baccddf4884307f4ebdeed9199fedb00debf4bc 100644
--- a/app/code/Magento/Usps/composer.json
+++ b/app/code/Magento/Usps/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-usps",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-shipping": "100.2.*",
         "magento/module-directory": "100.2.*",
diff --git a/app/code/Magento/Variable/composer.json b/app/code/Magento/Variable/composer.json
index 4cedfca248c9868d2e82160083ff16e727274a4f..21f3ec1dd467f240c609d5931ffa5cbde8dc3e15 100644
--- a/app/code/Magento/Variable/composer.json
+++ b/app/code/Magento/Variable/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-variable",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-backend": "100.2.*",
         "magento/module-email": "100.2.*",
         "magento/module-store": "100.2.*",
diff --git a/app/code/Magento/Vault/Model/Method/Vault.php b/app/code/Magento/Vault/Model/Method/Vault.php
index 3457bc6a0a61f52adf2c86f68752e9df653ab2f0..aa0bead2327eabfb0414fcdcd21d46121553d9ff 100644
--- a/app/code/Magento/Vault/Model/Method/Vault.php
+++ b/app/code/Magento/Vault/Model/Method/Vault.php
@@ -576,7 +576,8 @@ final class Vault implements VaultPaymentInterface
      */
     public function isAvailable(\Magento\Quote\Api\Data\CartInterface $quote = null)
     {
-        return $this->getVaultProvider()->isAvailable($quote);
+        return $this->getVaultProvider()->isAvailable($quote)
+            && $this->config->getValue(self::$activeKey, $this->getStore() ?: $quote->getStoreId());
     }
 
     /**
diff --git a/app/code/Magento/Vault/Test/Unit/Model/Method/VaultTest.php b/app/code/Magento/Vault/Test/Unit/Model/Method/VaultTest.php
index 2dcece98e770a4958f15eac057acf24df3a96531..32e783278e1301f3bf45a085edb7b81d72801cd7 100644
--- a/app/code/Magento/Vault/Test/Unit/Model/Method/VaultTest.php
+++ b/app/code/Magento/Vault/Test/Unit/Model/Method/VaultTest.php
@@ -8,8 +8,10 @@ namespace Magento\Vault\Test\Unit\Model\Method;
 use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
 use Magento\Payment\Gateway\Command\CommandManagerInterface;
 use Magento\Payment\Gateway\Command\CommandManagerPoolInterface;
+use Magento\Payment\Gateway\ConfigInterface;
 use Magento\Payment\Model\InfoInterface;
 use Magento\Payment\Model\MethodInterface;
+use Magento\Quote\Api\Data\CartInterface;
 use Magento\Sales\Api\Data\OrderPaymentExtensionInterface;
 use Magento\Sales\Api\Data\TransactionInterface;
 use Magento\Sales\Model\Order\Payment;
@@ -18,6 +20,10 @@ use Magento\Vault\Api\PaymentTokenManagementInterface;
 use Magento\Vault\Model\Method\Vault;
 use Magento\Vault\Model\VaultPaymentInterface;
 
+/**
+ * Class VaultTest
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ */
 class VaultTest extends \PHPUnit_Framework_TestCase
 {
     /**
@@ -209,4 +215,52 @@ class VaultTest extends \PHPUnit_Framework_TestCase
         $model = $this->objectManager->getObject(Vault::class);
         $model->capture($paymentModel, 0);
     }
+
+    /**
+     * @covers \Magento\Vault\Model\Method\Vault::isAvailable
+     * @dataProvider isAvailableDataProvider
+     */
+    public function testIsAvailable($isAvailableProvider, $isActive, $expected)
+    {
+        $storeId = 1;
+        $quote = $this->getMockForAbstractClass(CartInterface::class);
+        $vaultProvider = $this->getMockForAbstractClass(MethodInterface::class);
+        $config = $this->getMockForAbstractClass(ConfigInterface::class);
+
+        $vaultProvider->expects(static::once())
+            ->method('isAvailable')
+            ->with($quote)
+            ->willReturn($isAvailableProvider);
+
+        $config->expects(static::any())
+            ->method('getValue')
+            ->with('active', $storeId)
+            ->willReturn($isActive);
+
+        $quote->expects(static::any())
+            ->method('getStoreId')
+            ->willReturn($storeId);
+
+        /** @var Vault $model */
+        $model = $this->objectManager->getObject(Vault::class, [
+            'config' => $config,
+            'vaultProvider' => $vaultProvider
+        ]);
+        $actual = $model->isAvailable($quote);
+        static::assertEquals($expected, $actual);
+    }
+
+    /**
+     * List of variations for testing isAvailable method
+     * @return array
+     */
+    public function isAvailableDataProvider()
+    {
+        return [
+            ['isAvailableProvider' => true, 'isActiveVault' => false, 'expected' => false],
+            ['isAvailableProvider' => false, 'isActiveVault' => false, 'expected' => false],
+            ['isAvailableProvider' => false, 'isActiveVault' => true, 'expected' => false],
+            ['isAvailableProvider' => true, 'isActiveVault' => true, 'expected' => true],
+        ];
+    }
 }
diff --git a/app/code/Magento/Vault/composer.json b/app/code/Magento/Vault/composer.json
index f3db74c215f26b294a0611b6d9da361ff9e92d20..74dd568e3b45ee4e3e7f9e235d3389191b7a93e4 100644
--- a/app/code/Magento/Vault/composer.json
+++ b/app/code/Magento/Vault/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-vault",
     "description": "",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/framework": "100.2.*",
         "magento/module-sales": "100.2.*",
         "magento/module-store": "100.2.*",
diff --git a/app/code/Magento/Version/composer.json b/app/code/Magento/Version/composer.json
index ca8a0ef98d80827fd2c3a7e835c3c91fb59a5b31..3a972432101154fa2c4f167473fc6f4d6aa113a0 100644
--- a/app/code/Magento/Version/composer.json
+++ b/app/code/Magento/Version/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-version",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/framework": "100.2.*"
     },
     "type": "magento2-module",
diff --git a/app/code/Magento/Webapi/composer.json b/app/code/Magento/Webapi/composer.json
index 4cf2eb86adee05d6d7b084ba47ca12c61e812366..f2796df70a8fae522a34d0c94e079afd9f525f9c 100644
--- a/app/code/Magento/Webapi/composer.json
+++ b/app/code/Magento/Webapi/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-webapi",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-authorization": "100.2.*",
         "magento/module-integration": "100.2.*",
diff --git a/app/code/Magento/WebapiSecurity/composer.json b/app/code/Magento/WebapiSecurity/composer.json
index f3e02f82511d470bbbff0642e87fe1b2508cb12f..506975f1aa188d4f0d90f8d2f0484153998f2c39 100644
--- a/app/code/Magento/WebapiSecurity/composer.json
+++ b/app/code/Magento/WebapiSecurity/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-webapi-security",
     "description": "WebapiSecurity module provides option to loosen security on some webapi resources.",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-webapi": "100.2.*",
         "magento/framework": "100.2.*"
     },
diff --git a/app/code/Magento/Weee/composer.json b/app/code/Magento/Weee/composer.json
index baa70fa352d7a4b62114ac43fe6b886cf96328f2..20a43510937d270933dc0f9b65deacba7ffb843f 100644
--- a/app/code/Magento/Weee/composer.json
+++ b/app/code/Magento/Weee/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-weee",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-catalog": "101.1.*",
         "magento/module-tax": "100.2.*",
diff --git a/app/code/Magento/Widget/composer.json b/app/code/Magento/Widget/composer.json
index f4885500b77e10171beceace975679e81fa2c2d7..f59c4180eb2bb56522ae20f3615da92dd0c60370 100644
--- a/app/code/Magento/Widget/composer.json
+++ b/app/code/Magento/Widget/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-widget",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-cms": "101.1.*",
         "magento/module-backend": "100.2.*",
diff --git a/app/code/Magento/Wishlist/composer.json b/app/code/Magento/Wishlist/composer.json
index 68fbc5a30c8ed999fa80e46e366b3dce3e64c662..3faee8912493c96092f70d7fc3ca0e77164b39bc 100644
--- a/app/code/Magento/Wishlist/composer.json
+++ b/app/code/Magento/Wishlist/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/module-wishlist",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/module-store": "100.2.*",
         "magento/module-customer": "100.2.*",
         "magento/module-catalog": "101.1.*",
diff --git a/app/design/adminhtml/Magento/backend/composer.json b/app/design/adminhtml/Magento/backend/composer.json
index 7686e3c3ef855cd7c61ef0c5d869c5e6cb273019..29569db622d2ccc9fad9e9b87b3ad4f7ae4757d2 100644
--- a/app/design/adminhtml/Magento/backend/composer.json
+++ b/app/design/adminhtml/Magento/backend/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/theme-adminhtml-backend",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/framework": "100.2.*"
     },
     "type": "magento2-theme",
diff --git a/app/design/frontend/Magento/blank/composer.json b/app/design/frontend/Magento/blank/composer.json
index 0297d02a4ef949d5139c1d8cd9a3fe515f40a938..27ed40860dd5b065dc51e82f487722eb519ba215 100644
--- a/app/design/frontend/Magento/blank/composer.json
+++ b/app/design/frontend/Magento/blank/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/theme-frontend-blank",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/framework": "100.2.*"
     },
     "type": "magento2-theme",
diff --git a/app/design/frontend/Magento/luma/composer.json b/app/design/frontend/Magento/luma/composer.json
index 507ed10117d698a88b87c9b9b1ed083047c69527..98fe0ebf8061c23fa37d30a9551f05d5c41bce1b 100644
--- a/app/design/frontend/Magento/luma/composer.json
+++ b/app/design/frontend/Magento/luma/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/theme-frontend-luma",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/theme-frontend-blank": "100.2.*",
         "magento/framework": "100.2.*"
     },
diff --git a/composer.json b/composer.json
index b90db7519b5aa6fabc7839e13918e7d88d8d7c0f..76fbf6a25a125a1104730bfa8805b62861cf8303 100644
--- a/composer.json
+++ b/composer.json
@@ -8,7 +8,7 @@
         "AFL-3.0"
     ],
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "zendframework/zend-stdlib": "~2.4.6",
         "zendframework/zend-code": "~2.4.6",
         "zendframework/zend-server": "~2.4.6",
diff --git a/composer.lock b/composer.lock
index 897f4db750e35c4ad1f6ffb4cb9687520c5b36b7..b5ad3f09ea4f0cfc17d40ad49b026af795d884be 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,8 +4,8 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "hash": "e447a3cde1c69182cd539976df5284d2",
-    "content-hash": "77f475ee4b3a11984e7cebfd321a1081",
+    "hash": "9b461c73cd2e4f9b44405f2661f9d04b",
+    "content-hash": "2371141b038d4d1fb3753d78db86fa26",
     "packages": [
         {
             "name": "braintree/braintree_php",
@@ -4454,7 +4454,7 @@
     "prefer-stable": true,
     "prefer-lowest": false,
     "platform": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "lib-libxml": "*",
         "ext-ctype": "*",
         "ext-gd": "*",
diff --git a/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/composer.json b/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/composer.json
index d6b725ffd896aadba6ee73c84c9a790b984c64bd..629afd442a46e7549206c1520b1b6c75f024dcb1 100644
--- a/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/composer.json
+++ b/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/composer.json
@@ -2,7 +2,7 @@
   "name": "magento/module-test-module-integration-from-config",
   "description": "test integration create from config",
   "require": {
-    "php": "~5.6.0|7.0.2|~7.0.6",
+    "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
     "magento/framework": "0.42.0-beta8",
     "magento/module-integration": "0.42.0-beta8"
   },
diff --git a/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/composer.json b/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/composer.json
index 28b53da6cd8fa193da5c54a72768f438555756c9..1e2d9c0fa13dd80fcfe69374a7e02700f6b570ea 100644
--- a/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/composer.json
+++ b/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/composer.json
@@ -2,7 +2,7 @@
   "name": "magento/module-test-join-directives",
   "description": "test integration for join directives",
   "require": {
-    "php": "~5.6.0|7.0.2|~7.0.6",
+    "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
     "magento/framework": "0.42.0-beta8",
     "magento/module-sales": "0.42.0-beta8"
   },
diff --git a/dev/tests/functional/composer.json b/dev/tests/functional/composer.json
index f90a14e5491b5468aa786ee77b472b19e5001d5f..c8db587759f5366738b8c6d869f6918157961d69 100644
--- a/dev/tests/functional/composer.json
+++ b/dev/tests/functional/composer.json
@@ -1,7 +1,7 @@
 {
     "require": {
         "magento/mtf": "1.0.0-rc43",
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "phpunit/phpunit": "4.1.0",
         "phpunit/phpunit-selenium": ">=1.2"
     },
diff --git a/dev/tests/functional/tests/app/Magento/Authorizenet/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Authorizenet/Test/TestCase/OnePageCheckoutTest.xml
index 2ea4873f454a3cbdada0b94c96b90f6c5271b91c..c8cbd35427d288174ce64f0ea5df6474219444c4 100644
--- a/dev/tests/functional/tests/app/Magento/Authorizenet/Test/TestCase/OnePageCheckoutTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Authorizenet/Test/TestCase/OnePageCheckoutTest.xml
@@ -26,8 +26,7 @@
                 <item name="isClosed" xsi:type="string">No</item>
                 <item name="transactionType" xsi:type="string">Authorization</item>
             </data>
-            <data name="tag" xsi:type="string">test_type:3rd_party_test_deprecated</data>
-            <constraint name="Magento\Sales\Test\Constraint\AssertTransactionDetails" />
+            <data name="tag" xsi:type="string">test_type:3rd_party_test</data>
             <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" />
             <constraint name="Magento\Checkout\Test\Constraint\AssertMinicartEmpty" />
             <constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" />
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/History.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/History.php
index b3b0f4eafa74cc44467414cb127b08d099b7d7dd..2235122955a723ccc0cafcafc51d24934405e896 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/History.php
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/History.php
@@ -21,6 +21,13 @@ class History extends Block
      */
     protected $commentHistory = '.note-list-comment';
 
+    /**
+     * Authorized Amount.
+     *
+     * @var string
+     */
+    protected $authorizedAmount = '//div[@class="note-list-comment"][contains(text(), "Authorized amount of")]';
+
     /**
      * Captured Amount from IPN.
      *
@@ -53,6 +60,17 @@ class History extends Block
         return $this->_rootElement->find($this->commentHistory, Locator::SELECTOR_CSS)->getText();
     }
 
+    /**
+     * Get the authorized amount from the comments history.
+     *
+     * @return string
+     */
+    public function getAuthorizedAmount()
+    {
+        $this->waitCommentsHistory();
+        return $this->_rootElement->find($this->authorizedAmount, Locator::SELECTOR_XPATH)->getText();
+    }
+
     /**
      * Get the captured amount from the comments history.
      *
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAuthorizationInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAuthorizationInCommentsHistory.php
index 7495855d5351fac31be919a13d3bb604c486d8bb..a6b8e8983d2b617953b93490dc4c3a3e1079cec2 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAuthorizationInCommentsHistory.php
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAuthorizationInCommentsHistory.php
@@ -38,7 +38,7 @@ class AssertAuthorizationInCommentsHistory extends AbstractConstraint
         $salesOrder->open();
         $salesOrder->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]);
 
-        $actualAuthorizedAmount = $salesOrderView->getOrderHistoryBlock()->getCommentsHistory();
+        $actualAuthorizedAmount = $salesOrderView->getOrderHistoryBlock()->getAuthorizedAmount();
 
         \PHPUnit_Framework_Assert::assertContains(
             self::AUTHORIZED_AMOUNT . $prices['grandTotal'],
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertTransactionDetails.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertTransactionDetails.php
deleted file mode 100644
index f793d57df1108988f5a629fd90f5a20bea6935fa..0000000000000000000000000000000000000000
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertTransactionDetails.php
+++ /dev/null
@@ -1,69 +0,0 @@
-<?php
-/**
- * Copyright © 2016 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Sales\Test\Constraint;
-
-use Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Transactions\Grid;
-use Magento\Sales\Test\Fixture\OrderInjectable;
-use Magento\Sales\Test\Page\Adminhtml\OrderIndex;
-use Magento\Sales\Test\Page\Adminhtml\SalesOrderView;
-use Magento\Mtf\Constraint\AbstractConstraint;
-
-/**
- * Assert that transaction is present in the Transactions tab of the order with corresponding status
- */
-class AssertTransactionDetails extends AbstractConstraint
-{
-    /**
-     * Message about authorized amount in order.
-     */
-    const AUTHORIZED_AMOUNT = 'Authorized amount of $';
-
-    /**
-     * Assert that comment about authorized amount exist in Comments History section on order page in Admin.
-     *
-     * @param SalesOrderView $salesOrderView
-     * @param OrderIndex $salesOrder
-     * @param string $orderId
-     * @param array $transactionDetails
-     * @throws \Exception
-     */
-    public function processAssert(
-        SalesOrderView $salesOrderView,
-        OrderIndex $salesOrder,
-        $orderId,
-        array $transactionDetails
-    ) {
-        $transactionId = '';
-        $salesOrder->open();
-        $salesOrder->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]);
-        $comment = $salesOrderView->getOrderHistoryBlock()->getCommentsHistory();
-        preg_match('/(ID: ")(\w+-*\w+)(")/', $comment, $matches);
-        if (!empty($matches[2])) {
-            $transactionId = $matches[2];
-        }
-        \PHPUnit_Framework_Assert::assertNotEmpty($transactionId);
-        $orderForm = $salesOrderView->getOrderForm()->openTab('transactions');
-        /** @var Grid $grid */
-        $grid = $orderForm->getTab('transactions')->getGridBlock();
-        $actualTxnIds = $grid->getIds();
-        \PHPUnit_Framework_Assert::assertEquals(
-            $transactionDetails,
-            $actualTxnIds[$transactionId],
-            'Incorrect transaction details for the order #' . $orderId
-        );
-    }
-
-    /**
-     * Returns string representation of successful assertion.
-     *
-     * @return string
-     */
-    public function toString()
-    {
-        return "Message about transaction details are present in Transactions tab.";
-    }
-}
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/di.xml
index 9a8f26a0505ba37a65bed0d0728b9594d6f29185..ea687be19d3c34b0eeb5093690e54243731543ff 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/etc/di.xml
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/di.xml
@@ -36,9 +36,4 @@
             <argument name="severity" xsi:type="string">high</argument>
         </arguments>
     </type>
-    <type name="Magento\Sales\Test\Constraint\AssertTransactionDetails">
-        <arguments>
-            <argument name="severity" xsi:type="string">high</argument>
-        </arguments>
-    </type>
 </config>
diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/acceptance_unstable.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/acceptance_unstable.xml
new file mode 100644
index 0000000000000000000000000000000000000000..ac37fc159b40d5e8574117b3e347bd730cbec983
--- /dev/null
+++ b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/acceptance_unstable.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<!--
+/**
+ * Copyright © 2016 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+-->
+<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd">
+    <rule scope="testcase">
+        <allow>
+            <tag group="test_type" value="acceptance_test" />
+        </allow>
+    </rule>
+    <rule scope="variation">
+        <allow>
+            <tag group="test_type" value="acceptance_test" />
+            <tag group="stable" value="no" />
+        </allow>
+    </rule>
+</config>
diff --git a/dev/tests/integration/framework/Magento/TestFramework/Db/Mysql.php b/dev/tests/integration/framework/Magento/TestFramework/Db/Mysql.php
index 0ac0438f69ab7627924214d8ff615000cc64d841..2acfcaa96f2ac2a8269123bb1ec4213b990d3c66 100644
--- a/dev/tests/integration/framework/Magento/TestFramework/Db/Mysql.php
+++ b/dev/tests/integration/framework/Magento/TestFramework/Db/Mysql.php
@@ -13,6 +13,11 @@ namespace Magento\TestFramework\Db;
 
 class Mysql extends \Magento\TestFramework\Db\AbstractDb
 {
+    /**
+     * Default port
+     */
+    const DEFAULT_PORT = 3306;
+
     /**
      * Defaults extra file name
      */
@@ -32,12 +37,25 @@ class Mysql extends \Magento\TestFramework\Db\AbstractDb
      */
     private $_defaultsExtraFile;
 
+    /**
+     * Port number for connection
+     *
+     * @var integer
+     */
+    private $_port;
+
     /**
      * {@inheritdoc}
      */
     public function __construct($host, $user, $password, $schema, $varPath, \Magento\Framework\Shell $shell)
     {
         parent::__construct($host, $user, $password, $schema, $varPath, $shell);
+        $this->_port = self::DEFAULT_PORT;
+        if (strpos($this->_host, ':') !== false) {
+            list($host, $port) = explode(':', $this->_host);
+            $this->_host = $host;
+            $this->_port = (int) $port;
+        }
         $this->_dbDumpFile = $this->_varPath . '/setup_dump_' . $this->_schema . '.sql';
         $this->_defaultsExtraFile = rtrim($this->_varPath, '\\/') . '/' . self::DEFAULTS_EXTRA_FILE_NAME;
     }
@@ -49,10 +67,11 @@ class Mysql extends \Magento\TestFramework\Db\AbstractDb
     {
         $this->ensureDefaultsExtraFile();
         $this->_shell->execute(
-            'mysql --defaults-file=%s --host=%s %s -e %s',
+            'mysql --defaults-file=%s --host=%s --port=%s %s -e %s',
             [
                 $this->_defaultsExtraFile,
                 $this->_host,
+                $this->_port,
                 $this->_schema,
                 "DROP DATABASE `{$this->_schema}`; CREATE DATABASE `{$this->_schema}`"
             ]
@@ -86,8 +105,8 @@ class Mysql extends \Magento\TestFramework\Db\AbstractDb
     {
         $this->ensureDefaultsExtraFile();
         $this->_shell->execute(
-            'mysqldump --defaults-file=%s --host=%s  %s > %s',
-            [$this->_defaultsExtraFile, $this->_host, $this->_schema, $this->getSetupDbDumpFilename()]
+            'mysqldump --defaults-file=%s --host=%s --port=%s %s > %s',
+            [$this->_defaultsExtraFile, $this->_host, $this->_port, $this->_schema, $this->getSetupDbDumpFilename()]
         );
     }
 
@@ -102,8 +121,8 @@ class Mysql extends \Magento\TestFramework\Db\AbstractDb
             throw new \LogicException("DB dump file does not exist: " . $this->getSetupDbDumpFilename());
         }
         $this->_shell->execute(
-            'mysql --defaults-file=%s --host=%s %s < %s',
-            [$this->_defaultsExtraFile, $this->_host, $this->_schema, $this->getSetupDbDumpFilename()]
+            'mysql --defaults-file=%s --host=%s --port=%s %s < %s',
+            [$this->_defaultsExtraFile, $this->_host, $this->_port, $this->_schema, $this->getSetupDbDumpFilename()]
         );
     }
 
diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/composer.json b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/composer.json
index 5bc2a54a586106f7f3eb9a5268d35eeb48f42787..222e5ff822b043185e44719804e0af75d8809c6e 100644
--- a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/composer.json
+++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/composer.json
@@ -1,7 +1,7 @@
 {
     "name": "magento/module-a",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/framework": "0.1",
         "magento/module-b": "0.1"
     },
diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/composer.json b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/composer.json
index 5020e9e09f61fcdf76c8ae1495e3e845e1222221..57944758267fd668f541b34586a8eb9f7acd9c98 100644
--- a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/composer.json
+++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/composer.json
@@ -1,7 +1,7 @@
 {
     "name": "magento/module-b",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/framework": "0.74.0-beta6",
         "magento/module-a": "0.1"
     },
diff --git a/dev/tests/integration/testsuite/Magento/Widget/_files/design/adminhtml/magento_basic/composer.json b/dev/tests/integration/testsuite/Magento/Widget/_files/design/adminhtml/magento_basic/composer.json
index c4eaac5c94c1717701c0e5cae395bdd3ae61304d..920dc1289b0cfa00cd696b35fb495434830850f6 100644
--- a/dev/tests/integration/testsuite/Magento/Widget/_files/design/adminhtml/magento_basic/composer.json
+++ b/dev/tests/integration/testsuite/Magento/Widget/_files/design/adminhtml/magento_basic/composer.json
@@ -2,7 +2,7 @@
     "name": "magento/admin-Magento_Catalog",
     "description": "N/A",
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "magento/framework": "0.1.0-alpha103"
     },
     "type": "magento2-theme",
diff --git a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php
index d183a0f436ffb88af347d417cb43578132b878ac..fb555b30fc9e80fc3c0b7c612923564d384ad8d0 100644
--- a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php
+++ b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php
@@ -329,6 +329,12 @@ class Mysql extends \Zend_Db_Adapter_Pdo_Mysql implements AdapterInterface
             throw new \Zend_Db_Adapter_Exception('No host configured to connect');
         }
 
+        if (isset($this->_config['port'])) {
+            throw new \Zend_Db_Adapter_Exception('Port must be configured within host parameter (like localhost:3306');
+        }
+
+        unset($this->_config['port']);
+
         if (strpos($this->_config['host'], '/') !== false) {
             $this->_config['unix_socket'] = $this->_config['host'];
             unset($this->_config['host']);
diff --git a/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php b/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php
index 20a8ec9b8330782acbd9889b5782dd86bef5dbdb..feff4276cfc09cc038eb896215320700ef39cc5c 100644
--- a/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php
+++ b/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php
@@ -14,6 +14,8 @@ namespace Magento\Framework\DB\Test\Unit\Adapter\Pdo;
 use Magento\Framework\DB\Adapter\AdapterInterface;
 use Magento\Framework\DB\Select;
 use Magento\Framework\DB\Select\SelectRenderer;
+use Magento\Framework\Model\ResourceModel\Type\Db\Pdo\Mysql;
+use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
 
 class MysqlTest extends \PHPUnit_Framework_TestCase
 {
@@ -523,4 +525,28 @@ class MysqlTest extends \PHPUnit_Framework_TestCase
             ['short_table_name', ['field1', 'field2'], '', 'SHORT_TABLE_NAME_FIELD1_FIELD2'],
         ];
     }
+
+    public function testConfigValidation()
+    {
+        $subject = (new ObjectManager($this))->getObject(
+            Mysql::class,
+            [
+                'config' => ['host' => 'localhost'],
+            ]
+        );
+
+        $this->assertInstanceOf(Mysql::class, $subject);
+    }
+
+    /**
+     * @expectedException \InvalidArgumentException
+     * @expectedExceptionMessage Port must be configured within host (like 'localhost:33390') parameter, not within port
+     */
+    public function testConfigValidationByPortWithException()
+    {
+        (new ObjectManager($this))->getObject(
+            Mysql::class,
+            ['config' => ['host' => 'localhost', 'port' => '33390']]
+        );
+    }
 }
diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php b/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php
index e2cc95603f4761995a859fb83e68643fae353c41..8b6a2c23386ff3f7a4a83070d7ac268a0eb3849d 100644
--- a/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php
+++ b/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php
@@ -114,6 +114,12 @@ class Mysql extends \Magento\Framework\Model\ResourceModel\Type\Db implements Co
             }
         }
 
+        if (isset($config['port'])) {
+            throw new \InvalidArgumentException(
+                "Port must be configured within host (like '$config[host]:$config[port]') parameter, not within port"
+            );
+        }
+
         $config['active'] = !(
             $config['active'] === 'false'
             || $config['active'] === false
diff --git a/lib/internal/Magento/Framework/composer.json b/lib/internal/Magento/Framework/composer.json
index 43bdd86e15659ed3430e475b8e7755712b2b0220..e86bed1c03fafc40369900f092fc0a6b59d5d108 100644
--- a/lib/internal/Magento/Framework/composer.json
+++ b/lib/internal/Magento/Framework/composer.json
@@ -8,7 +8,7 @@
         "AFL-3.0"
     ],
     "require": {
-        "php": "~5.6.0|7.0.2|~7.0.6",
+        "php": "~5.6.0|7.0.2|7.0.4|~7.0.6",
         "ext-spl": "*",
         "ext-dom": "*",
         "ext-simplexml": "*",
diff --git a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php
index 577e787bdd5f286dc238fdce41f1a016a98051b2..bbd0a44254e89ce2e84d3bbe7e043ac80c76a435 100644
--- a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php
+++ b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php
@@ -7,7 +7,6 @@ namespace Magento\Setup\Console\Command;
 
 use Magento\Framework\Setup\ConsoleLogger;
 use Magento\Setup\Model\InstallerFactory;
-use Magento\Setup\Model\ObjectManagerProvider;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Output\OutputInterface;
@@ -29,21 +28,14 @@ class UpgradeCommand extends AbstractSetupCommand
      */
     private $installerFactory;
 
-    /**
-     * @var \Magento\Setup\Model\ObjectManagerProvider;
-     */
-    private $objectManagerProvider;
-
     /**
      * Constructor
      *
      * @param InstallerFactory $installerFactory
-     * @param ObjectManagerProvider $objectManagerProvider
      */
-    public function __construct(InstallerFactory $installerFactory, ObjectManagerProvider $objectManagerProvider)
+    public function __construct(InstallerFactory $installerFactory)
     {
         $this->installerFactory = $installerFactory;
-        $this->objectManagerProvider = $objectManagerProvider;
         parent::__construct();
     }
 
@@ -73,16 +65,6 @@ class UpgradeCommand extends AbstractSetupCommand
      */
     protected function execute(InputInterface $input, OutputInterface $output)
     {
-        $areaCode = 'setup';
-        /** @var \Magento\Framework\ObjectManagerInterface $objectManager */
-        $objectManager = $this->objectManagerProvider->get();
-        /** @var \Magento\Framework\App\State $appState */
-        $appState = $objectManager->get('Magento\Framework\App\State');
-        $appState->setAreaCode($areaCode);
-        /** @var \Magento\Framework\ObjectManager\ConfigLoaderInterface $configLoader */
-        $configLoader = $objectManager->get('Magento\Framework\ObjectManager\ConfigLoaderInterface');
-        $objectManager->configure($configLoader->load($areaCode));
-
         $keepGenerated = $input->getOption(self::INPUT_KEY_KEEP_GENERATED);
         $installer = $this->installerFactory->create(new ConsoleLogger($output));
         $installer->updateModulesSequence($keepGenerated);
diff --git a/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php b/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php
index 17d78718e4bf4bcdc2978c946fe98223b8169011..7c1f72a4edd27fb111ded76cc0b16a52f95d4865 100644
--- a/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php
@@ -7,35 +7,19 @@ namespace Magento\Setup\Test\Unit\Console\Command;
 
 use Magento\Setup\Console\Command\UpgradeCommand;
 use Symfony\Component\Console\Tester\CommandTester;
+use Magento\Framework\Console\Cli;
 
 class UpgradeCommandTest extends \PHPUnit_Framework_TestCase
 {
     public function testExecute()
     {
         $installerFactory = $this->getMock('Magento\Setup\Model\InstallerFactory', [], [], '', false);
-        $objectManagerProvider = $this->getMock('\Magento\Setup\Model\ObjectManagerProvider', [], [], '', false);
-        $objectManager = $this->getMockForAbstractClass('Magento\Framework\ObjectManagerInterface');
-        $configLoader = $this->getMockForAbstractClass('Magento\Framework\ObjectManager\ConfigLoaderInterface');
-        $configLoader->expects($this->once())->method('load')->willReturn(['some_key' => 'some_value']);
-        $state = $this->getMock('Magento\Framework\App\State', [], [], '', false);
-        $state->expects($this->once())->method('setAreaCode')->with('setup');
-        $objectManagerProvider->expects($this->once())->method('get')->willReturn($objectManager);
-        $objectManager->expects($this->once())->method('configure');
-        $state->expects($this->once())->method('setAreaCode')->with('setup');
         $installer = $this->getMock('Magento\Setup\Model\Installer', [], [], '', false);
         $installer->expects($this->at(0))->method('updateModulesSequence');
         $installer->expects($this->at(1))->method('installSchema');
         $installer->expects($this->at(2))->method('installDataFixtures');
         $installerFactory->expects($this->once())->method('create')->willReturn($installer);
-
-        $objectManager->expects($this->exactly(2))
-            ->method('get')
-            ->will($this->returnValueMap([
-                ['Magento\Framework\App\State', $state],
-                ['Magento\Framework\ObjectManager\ConfigLoaderInterface', $configLoader]
-            ]));
-
-        $commandTester = new CommandTester(new UpgradeCommand($installerFactory, $objectManagerProvider));
-        $commandTester->execute([]);
+        $commandTester = new CommandTester(new UpgradeCommand($installerFactory));
+        $this->assertSame(Cli::RETURN_SUCCESS, $commandTester->execute([]));
     }
 }
diff --git a/setup/src/Magento/Setup/Test/Unit/Validator/DbValidatorTest.php b/setup/src/Magento/Setup/Test/Unit/Validator/DbValidatorTest.php
index 5b076e122a6e11057928132344baf8357f2d0a6f..af60706fc438e41865aee39fa3a3746ce25eccb9 100644
--- a/setup/src/Magento/Setup/Test/Unit/Validator/DbValidatorTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Validator/DbValidatorTest.php
@@ -38,7 +38,7 @@ class DbValidatorTest extends \PHPUnit_Framework_TestCase
     public function testCheckDatabaseConnection()
     {
         $this->connection
-            ->expects($this->once())
+            ->expects($this->exactly(2))
             ->method('fetchOne')
             ->with('SELECT version()')
             ->willReturn('5.6.0-0ubuntu0.12.04.1');
@@ -79,6 +79,7 @@ class DbValidatorTest extends \PHPUnit_Framework_TestCase
                 ]
             );
         $this->assertEquals(true, $this->dbValidator->checkDatabaseConnection('name', 'host', 'user', 'password'));
+        $this->assertEquals(true, $this->dbValidator->checkDatabaseConnection('name', 'host:3339', 'user', 'password'));
     }
 
     /**