diff --git a/.travis.yml b/.travis.yml index 3b0108dd1abc7..75d26bdfa7d10 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ language: php php: - 5.4 - 5.5 + - 5.6 env: - TEST_SUITE=unit - TEST_SUITE=integration @@ -14,6 +15,10 @@ matrix: env: TEST_SUITE=static_phpcs - php: 5.4 env: TEST_SUITE=static_annotation + - php: 5.6 + env: TEST_SUITE=static_phpcs + - php: 5.6 + env: TEST_SUITE=static_annotation before_install: - sudo apt-get update -qq - sudo apt-get install -y -qq postfix diff --git a/app/bootstrap.php b/app/bootstrap.php index 07ef94f833e4a..183edeceabf33 100644 --- a/app/bootstrap.php +++ b/app/bootstrap.php @@ -14,15 +14,14 @@ /* PHP version validation */ if (version_compare(phpversion(), '5.4.11', '<') === true) { if (PHP_SAPI == 'cli') { - echo 'Magento supports PHP 5.4.11 or newer. Please read http://www.magento.com/install.'; + echo 'Magento supports PHP 5.4.11 or later. ' . + 'Please read http://devdocs.magento.com/guides/v1.0/install-gde/system-requirements.html'; } else { echo << -
-

- Whoops, it looks like you have an invalid PHP version.

-
-

Magento supports PHP 5.4.11 or newer. +

Magento supports PHP 5.4.11 or later. Please read + + Magento System Requirements. HTML; } diff --git a/app/code/Magento/AdminNotification/composer.json b/app/code/Magento/AdminNotification/composer.json index e9b5b30c4b27a..772dd77e5093f 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", "magento/module-backend": "0.42.0-beta3", diff --git a/app/code/Magento/Authorization/composer.json b/app/code/Magento/Authorization/composer.json index 7bd18ed1f9e5a..46060369cb7e6 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-backend": "0.42.0-beta3", "magento/framework": "0.42.0-beta3", "magento/magento-composer-installer": "*" diff --git a/app/code/Magento/Backend/composer.json b/app/code/Magento/Backend/composer.json index f4d31d310a34b..b1d54364d381f 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-directory": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", diff --git a/app/code/Magento/Backup/composer.json b/app/code/Magento/Backup/composer.json index ace6f3a147b3d..87a0225e86690 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", "magento/module-backend": "0.42.0-beta3", diff --git a/app/code/Magento/Bundle/composer.json b/app/code/Magento/Bundle/composer.json index a599817ab17e3..8580562292cb8 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-catalog": "0.42.0-beta3", "magento/module-tax": "0.42.0-beta3", diff --git a/app/code/Magento/Captcha/composer.json b/app/code/Magento/Captcha/composer.json index 7150fa76fd655..5cd84ce402336 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-customer": "0.42.0-beta3", "magento/module-checkout": "0.42.0-beta3", diff --git a/app/code/Magento/Catalog/composer.json b/app/code/Magento/Catalog/composer.json index 91175da5e7367..360e14b27de53 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-eav": "0.42.0-beta3", "magento/module-cms": "0.42.0-beta3", diff --git a/app/code/Magento/CatalogImportExport/composer.json b/app/code/Magento/CatalogImportExport/composer.json index eeb8648ddd4ca..b494e210bef94 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-core": "0.42.0-beta3", "magento/module-catalog": "0.42.0-beta3", "magento/module-eav": "0.42.0-beta3", diff --git a/app/code/Magento/CatalogInventory/composer.json b/app/code/Magento/CatalogInventory/composer.json index e8f04fc3a78e2..c226936f18f7b 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-catalog": "0.42.0-beta3", "magento/module-customer": "0.42.0-beta3", diff --git a/app/code/Magento/CatalogRule/composer.json b/app/code/Magento/CatalogRule/composer.json index 969c2d6fe508b..77813109ca80a 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-rule": "0.42.0-beta3", "magento/module-catalog": "0.42.0-beta3", diff --git a/app/code/Magento/CatalogSearch/composer.json b/app/code/Magento/CatalogSearch/composer.json index cdf03092c052b..1820067884907 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-catalog": "0.42.0-beta3", "magento/module-search": "0.42.0-beta3", diff --git a/app/code/Magento/CatalogUrlRewrite/composer.json b/app/code/Magento/CatalogUrlRewrite/composer.json index 6fe7f7bf36502..51e3cb2ed671e 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-backend": "0.42.0-beta3", "magento/module-catalog": "0.42.0-beta3", "magento/module-catalog-import-export": "0.42.0-beta3", diff --git a/app/code/Magento/CatalogWidget/composer.json b/app/code/Magento/CatalogWidget/composer.json index fd48c7c899588..0c728e7ef139c 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-catalog": "0.42.0-beta3", "magento/module-widget": "0.42.0-beta3", "magento/module-backend": "0.42.0-beta3", diff --git a/app/code/Magento/Centinel/composer.json b/app/code/Magento/Centinel/composer.json index cb24895c5bef8..23ce3a4a76fa1 100644 --- a/app/code/Magento/Centinel/composer.json +++ b/app/code/Magento/Centinel/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-centinel", "description": "N/A", "require": { - "php": "~5.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-checkout": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", diff --git a/app/code/Magento/Checkout/Model/Type/Onepage.php b/app/code/Magento/Checkout/Model/Type/Onepage.php index fbf014927c3d1..c49669e912c33 100644 --- a/app/code/Magento/Checkout/Model/Type/Onepage.php +++ b/app/code/Magento/Checkout/Model/Type/Onepage.php @@ -530,7 +530,7 @@ protected function _validateCustomerData(array $data) $quote = $this->getQuote(); $isCustomerNew = !$quote->getCustomerId(); $customer = $quote->getCustomer(); - $customerData = $this->extensibleDataObjectConverter->toFlatArray($customer); + $customerData = $this->extensibleDataObjectConverter->toFlatArray($customer, [], '\Magento\Customer\Api\Data\CustomerInterface'); /** @var Form $customerForm */ $customerForm = $this->_formFactory->create( @@ -594,7 +594,7 @@ protected function _validateCustomerData(array $data) $this->_objectCopyService->copyFieldsetToTarget( 'customer_account', 'to_quote', - $this->extensibleDataObjectConverter->toFlatArray($customer), + $this->extensibleDataObjectConverter->toFlatArray($customer, [], '\Magento\Customer\Api\Data\CustomerInterface'), $quote ); diff --git a/app/code/Magento/Checkout/composer.json b/app/code/Magento/Checkout/composer.json index 5ff87c86c62da..5571403235562 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-sales": "0.42.0-beta3", "magento/module-authorization": "0.42.0-beta3", diff --git a/app/code/Magento/CheckoutAgreements/composer.json b/app/code/Magento/CheckoutAgreements/composer.json index 90429b6faec2f..0e41b386f1a71 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-checkout": "0.42.0-beta3", "magento/module-store": "0.42.0-beta3", "magento/module-backend": "0.42.0-beta3", diff --git a/app/code/Magento/Cms/composer.json b/app/code/Magento/Cms/composer.json index c1b4f3cb82ba0..1bab1473f233a 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", "magento/module-theme": "0.42.0-beta3", diff --git a/app/code/Magento/CmsUrlRewrite/composer.json b/app/code/Magento/CmsUrlRewrite/composer.json index e5f0e68d9e21a..8566a9d1e0b73 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-cms": "0.42.0-beta3", "magento/module-store": "0.42.0-beta3", "magento/module-url-rewrite": "0.42.0-beta3", diff --git a/app/code/Magento/ConfigurableImportExport/composer.json b/app/code/Magento/ConfigurableImportExport/composer.json index 1ec2eb7039530..350b1f9762dae 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-catalog": "0.42.0-beta3", "magento/module-catalog-import-export": "0.42.0-beta3", "magento/module-eav": "0.42.0-beta3", diff --git a/app/code/Magento/ConfigurableProduct/composer.json b/app/code/Magento/ConfigurableProduct/composer.json index 36971f7dbd7a9..40614acdc7e88 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-catalog": "0.42.0-beta3", "magento/module-catalog-inventory": "0.42.0-beta3", diff --git a/app/code/Magento/Contact/composer.json b/app/code/Magento/Contact/composer.json index 7b8189d62e197..e746193309c4f 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-customer": "0.42.0-beta3", "magento/module-backend": "0.42.0-beta3", diff --git a/app/code/Magento/Core/composer.json b/app/code/Magento/Core/composer.json index 72ba792362df4..3d356da4d534d 100644 --- a/app/code/Magento/Core/composer.json +++ b/app/code/Magento/Core/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-core", "description": "N/A", "require": { - "php": "~5.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-backend": "0.42.0-beta3", "magento/module-cron": "0.42.0-beta3", diff --git a/app/code/Magento/Cron/composer.json b/app/code/Magento/Cron/composer.json index c3cdb1c2c8172..5d0310756d4a3 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-backend": "0.42.0-beta3", "magento/framework": "0.42.0-beta3", diff --git a/app/code/Magento/CurrencySymbol/composer.json b/app/code/Magento/CurrencySymbol/composer.json index 4853345442d1a..fe027d918ba32 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-page-cache": "0.42.0-beta3", "magento/module-directory": "0.42.0-beta3", diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Form.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Form.php index 48f82f167702c..554d71463d59a 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Form.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Form.php @@ -72,7 +72,11 @@ protected function _prepareForm() $form->addField('id', 'hidden', ['name' => 'customer_id']); $customer = $this->_customerRepository->getById($customerId); $form->setValues( - $this->_extensibleDataObjectConverter->toFlatArray($customer) + $this->_extensibleDataObjectConverter->toFlatArray( + $customer, + [], + '\Magento\Customer\Api\Data\CustomerInterface' + ) )->addValues( ['customer_id' => $customerId] ); diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Account.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Account.php index 1c42b1674ee7b..c459b24d4377b 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Account.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Account.php @@ -172,7 +172,11 @@ protected function _customizeFieldset($fieldset) ); $form->getElement('website_id')->setRenderer($renderer); - $accountData = $this->_extensibleDataObjectConverter->toFlatArray($this->_getCustomerDataObject()); + $accountData = $this->_extensibleDataObjectConverter->toFlatArray( + $this->_getCustomerDataObject(), + [], + '\Magento\Customer\Api\Data\CustomerInterface' + ); if ($this->_getCustomerDataObject()->getId()) { $customerFormFields = $this->_addEditCustomerFormFields($fieldset); diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/Validate.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/Validate.php index 3ba77a04f16a1..de2ad486e6b3d 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/Validate.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/Validate.php @@ -29,7 +29,11 @@ protected function _validateCustomer($response) $customerForm = $this->_formFactory->create( 'customer', 'adminhtml_customer', - $this->_extensibleDataObjectConverter->toFlatArray($customer), + $this->_extensibleDataObjectConverter->toFlatArray( + $customer, + [], + '\Magento\Customer\Api\Data\CustomerInterface' + ), true ); $customerForm->setInvisibleIgnored(true); diff --git a/app/code/Magento/Customer/Model/AccountManagement.php b/app/code/Magento/Customer/Model/AccountManagement.php index 28448a745f80a..56871b94cebd5 100644 --- a/app/code/Magento/Customer/Model/AccountManagement.php +++ b/app/code/Magento/Customer/Model/AccountManagement.php @@ -683,7 +683,7 @@ protected function createPasswordHash($password) public function validate(\Magento\Customer\Api\Data\CustomerInterface $customer) { $customerErrors = $this->validator->validateData( - $this->extensibleDataObjectConverter->toFlatArray($customer), + $this->extensibleDataObjectConverter->toFlatArray($customer, [], '\Magento\Customer\Api\Data\CustomerInterface'), [], 'customer' ); diff --git a/app/code/Magento/Customer/Model/Address/Mapper.php b/app/code/Magento/Customer/Model/Address/Mapper.php index 00e916c8d64f3..fe19174210d14 100644 --- a/app/code/Magento/Customer/Model/Address/Mapper.php +++ b/app/code/Magento/Customer/Model/Address/Mapper.php @@ -37,7 +37,7 @@ public function __construct(ExtensibleDataObjectConverter $extensibleDataObjectC */ public function toFlatArray($addressDataObject) { - $flatAddressArray = $this->extensibleDataObjectConverter->toFlatArray($addressDataObject); + $flatAddressArray = $this->extensibleDataObjectConverter->toFlatArray($addressDataObject, [], '\Magento\Customer\Api\Data\AddressInterface'); //preserve street $street = $addressDataObject->getStreet(); if (!empty($street) && is_array($street)) { diff --git a/app/code/Magento/Customer/Model/Customer/Mapper.php b/app/code/Magento/Customer/Model/Customer/Mapper.php index f2b17fde98ca9..92b618edb243d 100644 --- a/app/code/Magento/Customer/Model/Customer/Mapper.php +++ b/app/code/Magento/Customer/Model/Customer/Mapper.php @@ -36,7 +36,7 @@ public function __construct(ExtensibleDataObjectConverter $extensibleDataObjectC */ public function toFlatArray(CustomerInterface $customer) { - $flatArray = $this->extensibleDataObjectConverter->toNestedArray($customer); + $flatArray = $this->extensibleDataObjectConverter->toNestedArray($customer, [], '\Magento\Customer\Api\Data\CustomerInterface'); unset($flatArray["addresses"]); return ConvertArray::toFlatArray($flatArray); } diff --git a/app/code/Magento/Customer/Model/Resource/CustomerRepository.php b/app/code/Magento/Customer/Model/Resource/CustomerRepository.php index bafb724910396..47b67411fafbd 100644 --- a/app/code/Magento/Customer/Model/Resource/CustomerRepository.php +++ b/app/code/Magento/Customer/Model/Resource/CustomerRepository.php @@ -125,7 +125,9 @@ public function save(\Magento\Customer\Api\Data\CustomerInterface $customer, $pa { $this->validate($customer); $customerData = $this->extensibleDataObjectConverter->toFlatArray( - $this->customerBuilder->populate($customer)->setAddresses([])->create() + $this->customerBuilder->populate($customer)->setAddresses([])->create(), + [], + '\Magento\Customer\Api\Data\CustomerInterface' ); $customerModel = $this->customerFactory->create(['data' => $customerData]); $storeId = $customerModel->getStoreId(); diff --git a/app/code/Magento/Customer/Model/Resource/Group/Grid/ServiceCollection.php b/app/code/Magento/Customer/Model/Resource/Group/Grid/ServiceCollection.php index 53b90c7b0346a..22980e9d14f0c 100644 --- a/app/code/Magento/Customer/Model/Resource/Group/Grid/ServiceCollection.php +++ b/app/code/Magento/Customer/Model/Resource/Group/Grid/ServiceCollection.php @@ -67,7 +67,7 @@ public function loadData($printQuery = false, $logQuery = false) $groups = $searchResults->getItems(); foreach ($groups as $group) { $groupItem = new \Magento\Framework\Object(); - $groupItem->addData($this->simpleDataObjectConverter->toFlatArray($group)); + $groupItem->addData($this->simpleDataObjectConverter->toFlatArray($group, '\Magento\Customer\Api\Data\GroupInterface')); $this->_addItem($groupItem); } $this->_setIsLoaded(); diff --git a/app/code/Magento/Customer/composer.json b/app/code/Magento/Customer/composer.json index 82de4e2d55c2e..6a8f9941fef46 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-eav": "0.42.0-beta3", "magento/module-directory": "0.42.0-beta3", diff --git a/app/code/Magento/CustomerImportExport/composer.json b/app/code/Magento/CustomerImportExport/composer.json index 8c75a2a8de2a2..286d4febae3a2 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-backend": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", "magento/module-customer": "0.42.0-beta3", diff --git a/app/code/Magento/DesignEditor/composer.json b/app/code/Magento/DesignEditor/composer.json index f5b72a0874ab3..356553a6cc3b6 100644 --- a/app/code/Magento/DesignEditor/composer.json +++ b/app/code/Magento/DesignEditor/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-design-editor", "description": "N/A", "require": { - "php": "~5.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-theme": "0.42.0-beta3", "magento/module-backend": "0.42.0-beta3", diff --git a/app/code/Magento/Dhl/composer.json b/app/code/Magento/Dhl/composer.json index b2e95071a8a03..c9d78cbed3b5a 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-shipping": "0.42.0-beta3", "magento/module-backend": "0.42.0-beta3", diff --git a/app/code/Magento/Directory/composer.json b/app/code/Magento/Directory/composer.json index 088239d85ec08..58c7f5ad1dda2 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", "magento/module-backend": "0.42.0-beta3", diff --git a/app/code/Magento/Downloadable/composer.json b/app/code/Magento/Downloadable/composer.json index 466cd720eb5ae..c8c0562e88873 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-catalog": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", diff --git a/app/code/Magento/Eav/composer.json b/app/code/Magento/Eav/composer.json index 21bcb29c6c088..c60d271e7cf02 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", "magento/module-backend": "0.42.0-beta3", diff --git a/app/code/Magento/Email/composer.json b/app/code/Magento/Email/composer.json index 240a491b71ecf..9afda3f5b33af 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", "magento/module-cms": "0.42.0-beta3", diff --git a/app/code/Magento/Fedex/composer.json b/app/code/Magento/Fedex/composer.json index 88de88ae2fae4..c4bb50094eda0 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-shipping": "0.42.0-beta3", "magento/module-directory": "0.42.0-beta3", diff --git a/app/code/Magento/GiftMessage/composer.json b/app/code/Magento/GiftMessage/composer.json index 3ecf20cb4c879..2f330a2b6f519 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-catalog": "0.42.0-beta3", "magento/module-checkout": "0.42.0-beta3", diff --git a/app/code/Magento/GoogleAdwords/composer.json b/app/code/Magento/GoogleAdwords/composer.json index 56844a6388978..0e10e7361b8b5 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-sales": "0.42.0-beta3", "magento/framework": "0.42.0-beta3", diff --git a/app/code/Magento/GoogleAnalytics/composer.json b/app/code/Magento/GoogleAnalytics/composer.json index 8670a99b812d9..ad2a5c677de09 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-sales": "0.42.0-beta3", "magento/framework": "0.42.0-beta3", diff --git a/app/code/Magento/GoogleOptimizer/composer.json b/app/code/Magento/GoogleOptimizer/composer.json index 19d885ce706a0..6f3640d73b6b3 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-google-analytics": "0.42.0-beta3", "magento/module-catalog": "0.42.0-beta3", diff --git a/app/code/Magento/GoogleShopping/composer.json b/app/code/Magento/GoogleShopping/composer.json index 8423766d54ee5..38e35843f414a 100644 --- a/app/code/Magento/GoogleShopping/composer.json +++ b/app/code/Magento/GoogleShopping/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-google-shopping", "description": "N/A", "require": { - "php": "~5.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", "magento/module-backend": "0.42.0-beta3", diff --git a/app/code/Magento/GroupedImportExport/composer.json b/app/code/Magento/GroupedImportExport/composer.json index 8516d96ce021c..f53791499fbd2 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-catalog": "0.42.0-beta3", "magento/module-import-export": "0.42.0-beta3", "magento/module-catalog-import-export": "0.42.0-beta3", diff --git a/app/code/Magento/GroupedProduct/composer.json b/app/code/Magento/GroupedProduct/composer.json index 29b4d88ed9369..d276a035dacf7 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-catalog": "0.42.0-beta3", "magento/module-catalog-inventory": "0.42.0-beta3", diff --git a/app/code/Magento/ImportExport/composer.json b/app/code/Magento/ImportExport/composer.json index eff9685455645..89e4b1aab9805 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", "magento/module-backend": "0.42.0-beta3", diff --git a/app/code/Magento/Indexer/composer.json b/app/code/Magento/Indexer/composer.json index 37888cf563d46..98cc0400270d6 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-backend": "0.42.0-beta3", "magento/module-page-cache": "0.42.0-beta3", "magento/framework": "0.42.0-beta3", diff --git a/app/code/Magento/Integration/Model/Oauth/Consumer.php b/app/code/Magento/Integration/Model/Oauth/Consumer.php index d81963d6a98b2..768eb4e78884d 100644 --- a/app/code/Magento/Integration/Model/Oauth/Consumer.php +++ b/app/code/Magento/Integration/Model/Oauth/Consumer.php @@ -38,11 +38,17 @@ class Consumer extends \Magento\Framework\Model\AbstractModel implements Consume */ protected $_keyLengthFactory; + /** + * @var \Magento\Integration\Helper\Oauth\Data + */ + protected $dataHelper; + /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry * @param \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLengthFactory $keyLengthFactory * @param \Magento\Framework\Url\Validator $urlValidator + * @param \Magento\Integration\Helper\Oauth\Data $dataHelper * @param \Magento\Framework\Model\Resource\AbstractResource $resource * @param \Magento\Framework\Data\Collection\Db $resourceCollection * @param array $data @@ -52,12 +58,14 @@ public function __construct( \Magento\Framework\Registry $registry, \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLengthFactory $keyLengthFactory, \Magento\Framework\Url\Validator $urlValidator, + \Magento\Integration\Helper\Oauth\Data $dataHelper, \Magento\Framework\Model\Resource\AbstractResource $resource = null, \Magento\Framework\Data\Collection\Db $resourceCollection = null, array $data = [] ) { $this->_keyLengthFactory = $keyLengthFactory; $this->_urlValidator = $urlValidator; + $this->dataHelper = $dataHelper; parent::__construct($context, $registry, $resource, $resourceCollection, $data); } @@ -166,4 +174,13 @@ public function getCreatedAt() { return $this->getData('created_at'); } + + /** + * {@inheritdoc} + */ + public function isValidForTokenExchange() + { + $expiry = $this->dataHelper->getConsumerExpirationPeriod(); + return $expiry > $this->getResource()->getTimeInSecondsSinceCreation($this->getId()); + } } diff --git a/app/code/Magento/Integration/Model/Oauth/Token/Provider.php b/app/code/Magento/Integration/Model/Oauth/Token/Provider.php index b33786dacb484..81a6b538fd912 100644 --- a/app/code/Magento/Integration/Model/Oauth/Token/Provider.php +++ b/app/code/Magento/Integration/Model/Oauth/Token/Provider.php @@ -22,16 +22,6 @@ class Provider implements TokenProviderInterface */ protected $_tokenFactory; - /** - * @var \Magento\Integration\Helper\Oauth\Data - */ - protected $_dataHelper; - - /** - * @var \Magento\Framework\Stdlib\DateTime\DateTime - */ - protected $_date; - /** * @var \Psr\Log\LoggerInterface */ @@ -40,21 +30,15 @@ class Provider implements TokenProviderInterface /** * @param \Magento\Integration\Model\Oauth\Consumer\Factory $consumerFactory * @param \Magento\Integration\Model\Oauth\TokenFactory $tokenFactory - * @param \Magento\Integration\Helper\Oauth\Data $dataHelper - * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Psr\Log\LoggerInterface $logger */ public function __construct( \Magento\Integration\Model\Oauth\Consumer\Factory $consumerFactory, \Magento\Integration\Model\Oauth\TokenFactory $tokenFactory, - \Magento\Integration\Helper\Oauth\Data $dataHelper, - \Magento\Framework\Stdlib\DateTime\DateTime $date, \Psr\Log\LoggerInterface $logger ) { $this->_consumerFactory = $consumerFactory; $this->_tokenFactory = $tokenFactory; - $this->_dataHelper = $dataHelper; - $this->_date = $date; $this->logger = $logger; } @@ -64,9 +48,7 @@ public function __construct( public function validateConsumer($consumer) { // Must use consumer within expiration period. - $consumerTS = strtotime($consumer->getCreatedAt()); - $expiry = $this->_dataHelper->getConsumerExpirationPeriod(); - if ($this->_date->timestamp() - $consumerTS > $expiry) { + if (!$consumer->isValidForTokenExchange()) { throw new \Magento\Framework\Oauth\Exception( 'Consumer key has expired' ); diff --git a/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php b/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php index 9dbf856debf74..fa7d3be9807d8 100644 --- a/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php +++ b/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php @@ -57,4 +57,22 @@ public function _afterDelete(\Magento\Framework\Model\AbstractModel $object) $adapter->delete($this->getTable('oauth_token'), ['consumer_id' => $object->getId()]); return parent::_afterDelete($object); } + + /** + * Compute time in seconds since consumer was created. + * + * @param int $consumerId - The consumer id + * @return int - time lapsed in seconds + */ + public function getTimeInSecondsSinceCreation($consumerId) + { + $adapter = $this->_getReadAdapter(); + $select = $adapter->select() + ->from($this->getMainTable()) + ->reset(\Zend_Db_Select::COLUMNS) + ->columns('CURRENT_TIMESTAMP() - created_at') + ->where('entity_id = ?', $consumerId); + + return $adapter->fetchOne($select); + } } diff --git a/app/code/Magento/Integration/composer.json b/app/code/Magento/Integration/composer.json index e338720c70a04..39da0e6194a83 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", "magento/module-backend": "0.42.0-beta3", diff --git a/app/code/Magento/Integration/etc/adminhtml/system.xml b/app/code/Magento/Integration/etc/adminhtml/system.xml index d4b11016d71d7..70b08082df7e1 100644 --- a/app/code/Magento/Integration/etc/adminhtml/system.xml +++ b/app/code/Magento/Integration/etc/adminhtml/system.xml @@ -26,7 +26,7 @@ - Disable consumer key/secret credentials if not used within X seconds. + Consumer key/secret will expire if not used within X seconds after Oauth token exchange starts. diff --git a/app/code/Magento/LayeredNavigation/composer.json b/app/code/Magento/LayeredNavigation/composer.json index 49573c19c395f..a4cf2dc2cef49 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-catalog": "0.42.0-beta3", "magento/module-backend": "0.42.0-beta3", "magento/framework": "0.42.0-beta3", diff --git a/app/code/Magento/Log/composer.json b/app/code/Magento/Log/composer.json index 0d6c624364076..4bf9ba061b87f 100644 --- a/app/code/Magento/Log/composer.json +++ b/app/code/Magento/Log/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-log", "description": "N/A", "require": { - "php": "~5.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", "magento/module-customer": "0.42.0-beta3", diff --git a/app/code/Magento/Msrp/composer.json b/app/code/Magento/Msrp/composer.json index bdb16ee62dd3f..3d83446f5e40c 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-bundle": "0.42.0-beta3", "magento/module-catalog": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", diff --git a/app/code/Magento/Multishipping/composer.json b/app/code/Magento/Multishipping/composer.json index dd36c4b2060c4..756598d1fa2a9 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", "magento/module-checkout": "0.42.0-beta3", diff --git a/app/code/Magento/Newsletter/composer.json b/app/code/Magento/Newsletter/composer.json index b27b3b6fcfb71..4c9e57f393230 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", "magento/module-customer": "0.42.0-beta3", diff --git a/app/code/Magento/OfflinePayments/composer.json b/app/code/Magento/OfflinePayments/composer.json index 9b5d5235860fe..ebd7adb688e87 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-payment": "0.42.0-beta3", "magento/framework": "0.42.0-beta3", "magento/magento-composer-installer": "*" diff --git a/app/code/Magento/OfflineShipping/composer.json b/app/code/Magento/OfflineShipping/composer.json index e9e7ef8f54fb3..f233c74afbce1 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-backend": "0.42.0-beta3", "magento/module-shipping": "0.42.0-beta3", diff --git a/app/code/Magento/PageCache/composer.json b/app/code/Magento/PageCache/composer.json index b3041fb04b4bb..ea05fb95664ae 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-backend": "0.42.0-beta3", "magento/framework": "0.42.0-beta3", diff --git a/app/code/Magento/Payment/composer.json b/app/code/Magento/Payment/composer.json index cc11964c6765c..1f55fcdc3a829 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", "magento/module-sales": "0.42.0-beta3", diff --git a/app/code/Magento/Persistent/composer.json b/app/code/Magento/Persistent/composer.json index cba2e8d19e77e..022dc88e2fc3d 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-checkout": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", diff --git a/app/code/Magento/ProductAlert/composer.json b/app/code/Magento/ProductAlert/composer.json index f467753113522..b001db5d77d92 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-catalog": "0.42.0-beta3", "magento/module-customer": "0.42.0-beta3", diff --git a/app/code/Magento/Reports/composer.json b/app/code/Magento/Reports/composer.json index 4b4917b2b885e..817eb609ddfed 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-eav": "0.42.0-beta3", "magento/module-customer": "0.42.0-beta3", diff --git a/app/code/Magento/RequireJs/composer.json b/app/code/Magento/RequireJs/composer.json index 549d96bb95fa3..4c029c1c34159 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/framework": "0.42.0-beta3", "magento/magento-composer-installer": "*" }, diff --git a/app/code/Magento/Review/composer.json b/app/code/Magento/Review/composer.json index c880a35a57661..ec6e7e8629c79 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-catalog": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", diff --git a/app/code/Magento/Rss/composer.json b/app/code/Magento/Rss/composer.json index b094f07e3c2ee..74952b18d3133 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-backend": "0.42.0-beta3", "magento/framework": "0.42.0-beta3", diff --git a/app/code/Magento/Rule/composer.json b/app/code/Magento/Rule/composer.json index f6329429fd35d..023d077408adc 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-eav": "0.42.0-beta3", "magento/module-catalog": "0.42.0-beta3", diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php index 63a466cca2b8f..aaa9f93d05561 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php @@ -161,7 +161,7 @@ public function getFormValues() } catch (\Exception $e) { /** If customer does not exist do nothing. */ } - $data = isset($customer) ? $this->_extensibleDataObjectConverter->toFlatArray($customer) : []; + $data = isset($customer) ? $this->_extensibleDataObjectConverter->toFlatArray($customer, [], '\Magento\Customer\Api\Data\CustomerInterface') : []; foreach ($this->getQuote()->getData() as $key => $value) { if (strpos($key, 'customer_') === 0) { $data[substr($key, 9)] = $value; diff --git a/app/code/Magento/Sales/Model/Quote.php b/app/code/Magento/Sales/Model/Quote.php index e80697e6d628e..a34cc20245be5 100644 --- a/app/code/Magento/Sales/Model/Quote.php +++ b/app/code/Magento/Sales/Model/Quote.php @@ -684,7 +684,9 @@ public function setCustomer(\Magento\Customer\Api\Data\CustomerInterface $custom $this->setCustomerId($customer->getId()); $customerData = $this->objectFactory->create( $this->extensibleDataObjectConverter->toFlatArray( - $this->customerBuilder->populate($customer)->setAddresses([])->create() + $this->customerBuilder->populate($customer)->setAddresses([])->create(), + [], + '\Magento\Customer\Api\Data\CustomerInterface' ) ); $this->_objectCopyService->copyFieldsetToTarget('customer_account', 'to_quote', $customerData, $this); diff --git a/app/code/Magento/Sales/composer.json b/app/code/Magento/Sales/composer.json index 7d8b5af849848..dd52c6dec79cb 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-catalog": "0.42.0-beta3", "magento/module-customer": "0.42.0-beta3", diff --git a/app/code/Magento/SalesRule/composer.json b/app/code/Magento/SalesRule/composer.json index 01578977b6d0a..0bc6963fbfe82 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-rule": "0.42.0-beta3", "magento/module-catalog": "0.42.0-beta3", diff --git a/app/code/Magento/Search/composer.json b/app/code/Magento/Search/composer.json index 14b98f899019a..3b6df7b57463c 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/framework": "0.42.0-beta3", "magento/module-backend": "0.42.0-beta3", "magento/module-store": "0.42.0-beta3", diff --git a/app/code/Magento/Sendfriend/composer.json b/app/code/Magento/Sendfriend/composer.json index a88aa094e39d4..79e1041b4822d 100644 --- a/app/code/Magento/Sendfriend/composer.json +++ b/app/code/Magento/Sendfriend/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-sendfriend", "description": "N/A", "require": { - "php": "~5.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-catalog": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", diff --git a/app/code/Magento/Shipping/composer.json b/app/code/Magento/Shipping/composer.json index 4b5b85bf70fac..08a1e9d7969cd 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", "magento/module-catalog": "0.42.0-beta3", diff --git a/app/code/Magento/Sitemap/composer.json b/app/code/Magento/Sitemap/composer.json index 9855debc8e8dd..b22d1586a32d6 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-catalog": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", diff --git a/app/code/Magento/Store/composer.json b/app/code/Magento/Store/composer.json index 4533617012e78..e089091493ed4 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-core": "0.42.0-beta3", "magento/module-directory": "0.42.0-beta3", "magento/module-ui": "0.42.0-beta3", diff --git a/app/code/Magento/Tax/composer.json b/app/code/Magento/Tax/composer.json index ab8e020070b34..5c54feeea3e74 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-catalog": "0.42.0-beta3", "magento/module-customer": "0.42.0-beta3", diff --git a/app/code/Magento/TaxImportExport/composer.json b/app/code/Magento/TaxImportExport/composer.json index 918d877d1dbab..d49ee464fd3e6 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-tax": "0.42.0-beta3", "magento/module-backend": "0.42.0-beta3", "magento/module-directory": "0.42.0-beta3", diff --git a/app/code/Magento/Theme/composer.json b/app/code/Magento/Theme/composer.json index 0326e580986db..9b67f6efa161a 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", "magento/module-customer": "0.42.0-beta3", diff --git a/app/code/Magento/Translation/composer.json b/app/code/Magento/Translation/composer.json index 6e4e8611f7d04..259dadd131c12 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-core": "0.42.0-beta3", "magento/module-store": "0.42.0-beta3", "magento/module-backend": "0.42.0-beta3", diff --git a/app/code/Magento/Ui/composer.json b/app/code/Magento/Ui/composer.json index 5cf8c3a3c1c09..efe3403132d45 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-backend": "0.42.0-beta3", "magento/module-store": "0.42.0-beta3", "magento/framework": "0.42.0-beta3", diff --git a/app/code/Magento/Ups/composer.json b/app/code/Magento/Ups/composer.json index 29d0e8402b6e1..42d5f994aeb4d 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", "magento/module-backend": "0.42.0-beta3", diff --git a/app/code/Magento/UrlRewrite/composer.json b/app/code/Magento/UrlRewrite/composer.json index 45565518903cb..a108f1b23a17f 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-catalog": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", "magento/module-store": "0.42.0-beta3", diff --git a/app/code/Magento/User/composer.json b/app/code/Magento/User/composer.json index b99e2d40a5cf5..4bfac9339fc56 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-authorization": "0.42.0-beta3", "magento/module-backend": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", diff --git a/app/code/Magento/Usps/composer.json b/app/code/Magento/Usps/composer.json index 65df78205d6dd..b7c72cec3da72 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-shipping": "0.42.0-beta3", "magento/module-directory": "0.42.0-beta3", diff --git a/app/code/Magento/Webapi/composer.json b/app/code/Magento/Webapi/composer.json index 6802e87bff62d..755ecba204525 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-authorization": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", diff --git a/app/code/Magento/Weee/composer.json b/app/code/Magento/Weee/composer.json index 6e5f5cc7355f1..fb0b9a6779c99 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-catalog": "0.42.0-beta3", "magento/module-tax": "0.42.0-beta3", diff --git a/app/code/Magento/Widget/composer.json b/app/code/Magento/Widget/composer.json index 699c31660c5d8..3a4c1b875c684 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-cms": "0.42.0-beta3", "magento/module-core": "0.42.0-beta3", diff --git a/app/code/Magento/Wishlist/composer.json b/app/code/Magento/Wishlist/composer.json index c2cfe413a8556..d6dc5b534083e 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-store": "0.42.0-beta3", "magento/module-customer": "0.42.0-beta3", "magento/module-catalog": "0.42.0-beta3", diff --git a/app/design/adminhtml/Magento/backend/composer.json b/app/design/adminhtml/Magento/backend/composer.json index 7f95ddc97973c..95c694e034fba 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/framework": "0.42.0-beta3", "magento/magento-composer-installer": "*" }, diff --git a/app/design/frontend/Magento/blank/composer.json b/app/design/frontend/Magento/blank/composer.json index d906616da07e3..f6da390cca977 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/framework": "0.42.0-beta3", "magento/magento-composer-installer": "*" }, diff --git a/app/design/frontend/Magento/luma/composer.json b/app/design/frontend/Magento/luma/composer.json index d0ac21fd996b3..3c8c3377313a6 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/theme-frontend-blank": "0.42.0-beta3", "magento/framework": "0.42.0-beta3", "magento/magento-composer-installer": "*" diff --git a/composer.json b/composer.json index a801c20718984..f7f2c094298ce 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "AFL-3.0" ], "require": { - "php": "~5.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "zendframework/zend-stdlib": "2.3.1", "zendframework/zend-code": "2.3.1", "zendframework/zend-server": "2.3.1", diff --git a/composer.lock b/composer.lock index b2d6cf8b9bd13..f91dcc508eef9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "19eac8fd6ecb4a7868d40ea31ad2a62b", + "hash": "0ea0b1b2f6f0a7fb58a4780375a1a440", "packages": [ { "name": "composer/composer", @@ -3143,8 +3143,9 @@ "phpmd/phpmd": 0 }, "prefer-stable": false, + "prefer-lowest": false, "platform": { - "php": "~5.4.11|~5.5.0" + "php": "~5.4.11|~5.5.0|~5.6.0" }, "platform-dev": { "lib-libxml": "*", diff --git a/dev/tests/api-functional/testsuite/Magento/Webapi/Authentication/RestTest.php b/dev/tests/api-functional/testsuite/Magento/Webapi/Authentication/RestTest.php index a730843207886..29b5f27cad377 100644 --- a/dev/tests/api-functional/testsuite/Magento/Webapi/Authentication/RestTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Webapi/Authentication/RestTest.php @@ -176,7 +176,7 @@ public function testGetAccessTokenConsumerMismatch() /** * @expectedException \Exception - * @expectedExceptionMessage HTTP/1.1 401 + * @expectedExceptionMessage HTTP/1.1 400 */ public function testAccessApiInvalidAccessToken() { diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/GroupTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/GroupTest.php index b2e0a0faeee5a..c2bfd2d17ffec 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/GroupTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/GroupTest.php @@ -146,7 +146,8 @@ public function testSaveActionExistingGroup() $simpleDataObjectConverter = Bootstrap::getObjectManager() ->get('Magento\Framework\Api\SimpleDataObjectConverter'); $customerGroupData = $simpleDataObjectConverter->toFlatArray( - $this->groupRepository->getById($groupId) + $this->groupRepository->getById($groupId), + 'Magento\Customer\Api\Data\GroupInterface' ); ksort($customerGroupData); diff --git a/dev/tests/integration/testsuite/Magento/Customer/Model/AccountManagementTest.php b/dev/tests/integration/testsuite/Magento/Customer/Model/AccountManagementTest.php index dcf4887456609..515ddf30ea4b2 100755 --- a/dev/tests/integration/testsuite/Magento/Customer/Model/AccountManagementTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Model/AccountManagementTest.php @@ -599,8 +599,16 @@ public function testCreateNonexistingCustomer() 'aPassword', true ); - $attributesBefore = $this->extensibleDataObjectConverter->toFlatArray($existingCustomer); - $attributesAfter = $this->extensibleDataObjectConverter->toFlatArray($customerAfter); + $attributesBefore = $this->extensibleDataObjectConverter->toFlatArray( + $existingCustomer, + [], + '\Magento\Customer\Api\Data\CustomerInterface' + ); + $attributesAfter = $this->extensibleDataObjectConverter->toFlatArray( + $customerAfter, + [], + '\Magento\Customer\Api\Data\CustomerInterface' + ); // ignore 'updated_at' unset($attributesBefore['updated_at']); unset($attributesAfter['updated_at']); @@ -670,7 +678,10 @@ public function testCreateCustomerInServiceVsInModel() $simpleDataObjectConverter = Bootstrap::getObjectManager() ->get('Magento\Framework\Api\SimpleDataObjectConverter'); - $dataInService = $simpleDataObjectConverter->toFlatArray($savedCustomer); + $dataInService = $simpleDataObjectConverter->toFlatArray( + $savedCustomer, + 'Magento\Customer\Api\Data\CustomerInterface' + ); $expectedDifferences = [ 'created_at', 'updated_at', diff --git a/dev/tests/integration/testsuite/Magento/Customer/Model/CustomerMetadataTest.php b/dev/tests/integration/testsuite/Magento/Customer/Model/CustomerMetadataTest.php index 995c704225ffb..b18d1c2b598e8 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Model/CustomerMetadataTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Model/CustomerMetadataTest.php @@ -120,7 +120,7 @@ public function testGetCustomerAttributeMetadata() 'id' => 1, 'website_id' => 1, 'store_id' => 1, - 'group_id' => '1', + 'group_id' => 1, 'firstname' => 'John', 'lastname' => 'Smith', 'email' => 'customer@example.com', @@ -132,7 +132,11 @@ public function testGetCustomerAttributeMetadata() $customer = $this->customerRepository->getById(1); $this->assertNotNull($customer); - $attributes = $this->_extensibleDataObjectConverter->toFlatArray($customer); + $attributes = $this->_extensibleDataObjectConverter->toFlatArray( + $customer, + [], + '\Magento\Customer\Api\Data\CustomerInterface' + ); $this->assertNotEmpty($attributes); foreach ($attributes as $attributeCode => $attributeValue) { diff --git a/dev/tests/integration/testsuite/Magento/Customer/Model/Resource/CustomerRepositoryTest.php b/dev/tests/integration/testsuite/Magento/Customer/Model/Resource/CustomerRepositoryTest.php index 09a16ec2ba0cc..7597cd2e846c0 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Model/Resource/CustomerRepositoryTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Model/Resource/CustomerRepositoryTest.php @@ -141,8 +141,16 @@ public function testUpdateCustomer() $this->assertEquals('Admin', $customerAfter->getCreatedIn()); $passwordFromFixture = 'password'; $this->accountManagement->authenticate($customerAfter->getEmail(), $passwordFromFixture); - $attributesBefore = $this->converter->toFlatArray($customerBefore); - $attributesAfter = $this->converter->toFlatArray($customerAfter); + $attributesBefore = $this->converter->toFlatArray( + $customerBefore, + [], + '\Magento\Customer\Api\Data\CustomerInterface' + ); + $attributesAfter = $this->converter->toFlatArray( + $customerAfter, + [], + '\Magento\Customer\Api\Data\CustomerInterface' + ); // ignore 'updated_at' unset($attributesBefore['updated_at']); unset($attributesAfter['updated_at']); diff --git a/dev/tests/integration/testsuite/Magento/Framework/Code/Reader/SourceArgumentsReaderTest.php b/dev/tests/integration/testsuite/Magento/Framework/Code/Reader/SourceArgumentsReaderTest.php new file mode 100644 index 0000000000000..076d2ab396be5 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/Code/Reader/SourceArgumentsReaderTest.php @@ -0,0 +1,57 @@ +sourceArgumentsReader = new \Magento\Framework\Code\Reader\SourceArgumentsReader(); + } + + /** + * @param string $class + * @param array $expectedResult + * @dataProvider getConstructorArgumentTypesDataProvider + */ + public function testGetConstructorArgumentTypes($class, $expectedResult) + { + $class = new \ReflectionClass($class); + $actualResult = $this->sourceArgumentsReader->getConstructorArgumentTypes($class); + $this->assertEquals($expectedResult, $actualResult); + } + + public function getConstructorArgumentTypesDataProvider() + { + return [ + [ + 'Some\Testing\Name\Space\AnotherSimpleClass', + [ + '\Some\Testing\Name\Space\Item', + '\Imported\Name\Space\One', + '\Imported\Name\Space\AnotherTest\Extended', + '\Imported\Name\Space\Test', + '\Imported\Name\Space\Object\Under\Test', + '\Imported\Name\Space\Object', + '\Some\Testing\Name\Space\Test', + 'array', + '' + ], + ], + [ + '\stdClass', + [null] + ] + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Framework/Code/Reader/_files/SourceArgumentsReaderTest.php.sample b/dev/tests/integration/testsuite/Magento/Framework/Code/Reader/_files/SourceArgumentsReaderTest.php.sample new file mode 100644 index 0000000000000..b2cb559cce531 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/Code/Reader/_files/SourceArgumentsReaderTest.php.sample @@ -0,0 +1,26 @@ +_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); @@ -35,24 +45,27 @@ protected function setUp() if ($sessionManager->isSessionExists()) { $sessionManager->writeClose(); } - $deploymentConfigMock = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false); - $deploymentConfigMock->expects($this->at(0)) + $this->deploymentConfigMock = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false); + $this->deploymentConfigMock->expects($this->at(0)) ->method('get') ->with(Config::PARAM_SESSION_SAVE_METHOD, 'files') ->will($this->returnValue('files')); - $deploymentConfigMock->expects($this->at(1)) + $this->deploymentConfigMock->expects($this->at(1)) ->method('get') ->with(Config::PARAM_SESSION_SAVE_PATH) ->will($this->returnValue(null)); - $deploymentConfigMock->expects($this->at(2)) + $this->deploymentConfigMock->expects($this->at(2)) ->method('get') ->with(Config::PARAM_SESSION_CACHE_LIMITER) ->will($this->returnValue($this->_cacheLimiter)); $this->_model = $this->_objectManager->create( 'Magento\Framework\Session\Config', - ['deploymentConfig' => $deploymentConfigMock] + ['deploymentConfig' => $this->deploymentConfigMock] ); + $this->defaultSavePath = $this->_objectManager + ->get('Magento\Framework\Filesystem\DirectoryList') + ->getPath(DirectoryList::SESSION); } protected function tearDown() @@ -283,4 +296,47 @@ public function testSetSavePath() $this->_model->setSavePath('some_save_path'); $this->assertEquals($this->_model->getOption('save_path'), 'some_save_path'); } + + /** + * @dataProvider savePathDataProvider + */ + public function testConstructorSavePath($existing, $given, $expected) + { + $sessionSavePath = ini_get('session.save_path'); + if ($expected === 'default') { + $expected = $this->defaultSavePath . '/'; + } + $setup = ini_set('session.save_path', $existing); + if ($setup === false) { + $this->markTestSkipped('Cannot set session.save_path with ini_set'); + } + + $this->deploymentConfigMock->expects($this->at(1)) + ->method('get') + ->with(Config::PARAM_SESSION_SAVE_PATH) + ->will($this->returnValue($given)); + + $this->_model = $this->_objectManager->create( + 'Magento\Framework\Session\Config', + ['deploymentConfig' => $this->deploymentConfigMock] + ); + $this->assertEquals($expected, $this->_model->getOption('save_path')); + + if ($sessionSavePath != ini_get('session.save_path')) { + ini_set('session.save_path', $sessionSavePath); + } + } + + public function savePathDataProvider() + { + // preset value (null = not set), input value (null = not set), expected value + $savePathGiven = 'explicit_save_path'; + $presetPath = 'preset_save_path'; + return [ + [null, $savePathGiven, $savePathGiven], + [null, null, 'default'], + [$presetPath, $savePathGiven, $savePathGiven], + [$presetPath, null, $presetPath], + ]; + } } diff --git a/dev/tests/integration/testsuite/Magento/Test/Tools/Dependency/_files/composer1.json b/dev/tests/integration/testsuite/Magento/Test/Tools/Dependency/_files/composer1.json index ba3e319204ac8..4fe637e35fcd3 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Tools/Dependency/_files/composer1.json +++ b/dev/tests/integration/testsuite/Magento/Test/Tools/Dependency/_files/composer1.json @@ -2,7 +2,7 @@ "name": "magento/module-module1", "description": "N/A", "require": { - "php": "~5.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-core": "0.1.0-alpha103", "magento/module-module2": "0.1.0-alpha103" }, diff --git a/dev/tests/integration/testsuite/Magento/Test/Tools/Dependency/_files/composer2.json b/dev/tests/integration/testsuite/Magento/Test/Tools/Dependency/_files/composer2.json index 3b45c34a4994f..a7b58c71e34c7 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Tools/Dependency/_files/composer2.json +++ b/dev/tests/integration/testsuite/Magento/Test/Tools/Dependency/_files/composer2.json @@ -2,7 +2,7 @@ "name": "magento/module-module2", "description": "N/A", "require": { - "php": "~5.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-core": "0.1.0-alpha103", "magento/module-module3": "0.1.0-alpha103" }, diff --git a/dev/tests/integration/testsuite/Magento/Test/Tools/Dependency/_files/composer3.json b/dev/tests/integration/testsuite/Magento/Test/Tools/Dependency/_files/composer3.json index 9501dd68bb121..4619c88460d9b 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Tools/Dependency/_files/composer3.json +++ b/dev/tests/integration/testsuite/Magento/Test/Tools/Dependency/_files/composer3.json @@ -2,7 +2,7 @@ "name": "magento/module-module1", "description": "N/A", "require": { - "php": "~5.4.11|~5.5.0" + "php": "~5.4.11|~5.5.0|~5.6.0" }, "type": "magento2-module", "version": "0.1.0-alpha103" diff --git a/dev/tests/integration/testsuite/Magento/Test/Tools/Dependency/_files/composer4.json b/dev/tests/integration/testsuite/Magento/Test/Tools/Dependency/_files/composer4.json index 723f4f9e6cdf5..441ed7e5af1aa 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Tools/Dependency/_files/composer4.json +++ b/dev/tests/integration/testsuite/Magento/Test/Tools/Dependency/_files/composer4.json @@ -2,7 +2,7 @@ "name": "magento/module-module1", "description": "N/A", "require": { - "php": "~5.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-core": "0.1.0-alpha103", "magento/module-module2": "0.1.0-alpha103" }, diff --git a/dev/tests/integration/testsuite/Magento/Test/Tools/Dependency/_files/composer5.json b/dev/tests/integration/testsuite/Magento/Test/Tools/Dependency/_files/composer5.json index 8df20906f117c..a630787a56681 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Tools/Dependency/_files/composer5.json +++ b/dev/tests/integration/testsuite/Magento/Test/Tools/Dependency/_files/composer5.json @@ -2,7 +2,7 @@ "name": "magento/module-module2", "description": "N/A", "require": { - "php": "~5.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/module-core": "0.1.0-alpha103", "magento/module-module1": "0.1.0-alpha103" }, diff --git a/dev/tests/integration/testsuite/Magento/Weee/Model/TaxTest.php b/dev/tests/integration/testsuite/Magento/Weee/Model/TaxTest.php index b6a0a0df886ec..8a94168c895cf 100644 --- a/dev/tests/integration/testsuite/Magento/Weee/Model/TaxTest.php +++ b/dev/tests/integration/testsuite/Magento/Weee/Model/TaxTest.php @@ -58,7 +58,7 @@ public function testGetProductWeeeAttributes() ['metadataService' => $customerMetadataService] ); $expected = $this->_extensibleDataObjectConverter->toFlatArray( - $customerRepository->getById(1) + $customerRepository->getById(1), [], '\Magento\Customer\Api\Data\CustomerInterface' ); $customerBuilder->populateWithArray($expected); $customerDataSet = $customerBuilder->create(); 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 16bcf44b85c2c..4a5c0d27cd304 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/framework": "0.1.0-alpha103", "magento/magento-composer-installer": "*" }, diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Di/CompilerTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Di/CompilerTest.php index 1ff0b7bea34a9..0510c8cb4fec8 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Di/CompilerTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Di/CompilerTest.php @@ -103,6 +103,7 @@ protected function setUp() $this->_validator->add(new \Magento\Framework\Code\Validator\ContextAggregation()); $this->_validator->add(new \Magento\Framework\Code\Validator\TypeDuplication()); $this->_validator->add(new \Magento\Framework\Code\Validator\ArgumentSequence()); + $this->_validator->add(new \Magento\Framework\Code\Validator\ConstructorArgumentTypes()); $this->pluginValidator = new \Magento\Framework\Interception\Code\InterfaceValidator(); } diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/_files/frontend/magento_iphone/composer.json b/dev/tests/unit/testsuite/Magento/Core/Model/_files/frontend/magento_iphone/composer.json index fa9ae3e082f96..1d60a88e8431e 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/_files/frontend/magento_iphone/composer.json +++ b/dev/tests/unit/testsuite/Magento/Core/Model/_files/frontend/magento_iphone/composer.json @@ -2,7 +2,7 @@ "name": "magento/frontend-magento_iphone", "description": "N/A", "require": { - "php": "~5.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "magento/framework": "0.1.0-alpha103", "magento/magento-composer-installer": "*" }, diff --git a/dev/tests/unit/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/AccountTest.php b/dev/tests/unit/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/AccountTest.php index fe8dd904a4eff..c815cf90e997e 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/AccountTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/AccountTest.php @@ -187,6 +187,7 @@ private function _setupStoreMode($customerData, $isSingleStoreMode, $canModifyCu 'adminhtml_customer', $this->extensibleDataObjectConverterMock->toFlatArray( $customerObject, + [], '\Magento\Customer\Api\Data\CustomerInterface' ) ) diff --git a/dev/tests/unit/testsuite/Magento/Framework/App/DeploymentConfig/BackendConfigTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/DeploymentConfig/BackendConfigTest.php index ee5d58e7b0e8f..8276e53d7bee5 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/App/DeploymentConfig/BackendConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/DeploymentConfig/BackendConfigTest.php @@ -24,11 +24,20 @@ public function testGetData() * @expectedException \InvalidArgumentException * @expectedExceptionMessage No backend frontname provided. */ - public function testEmptyData() + public function testUnsetData() { new BackendConfig([]); } + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage No backend frontname provided. + */ + public function testEmptyData() + { + new BackendConfig(['frontName' => '']); + } + /** * @param array $data * @dataProvider invalidDataDataProvider diff --git a/dev/tests/unit/testsuite/Magento/Framework/App/SetupInfoTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/SetupInfoTest.php index a7e953bfb2724..ad7a05c05ced9 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/App/SetupInfoTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/SetupInfoTest.php @@ -181,6 +181,14 @@ public function isAvailableDataProvider() ], false ], + 'root within doc root, existent sub-directory, trailing slash' => [ + [ + 'DOCUMENT_ROOT' => dirname(__DIR__) . DIRECTORY_SEPARATOR, + 'SCRIPT_FILENAME' => __FILE__, + SetupInfo::PARAM_NOT_INSTALLED_URL_PATH => '_files' + ], + true + ], ]; } } diff --git a/dev/tests/unit/testsuite/Magento/Framework/Code/Validator/ConstructorArgumentTypesTest.php b/dev/tests/unit/testsuite/Magento/Framework/Code/Validator/ConstructorArgumentTypesTest.php new file mode 100644 index 0000000000000..0de3d403d5885 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Framework/Code/Validator/ConstructorArgumentTypesTest.php @@ -0,0 +1,75 @@ +argumentsReaderMock = $this->getMock( + '\Magento\Framework\Code\Reader\ArgumentsReader', + [], + [], + '', + false + ); + $this->sourceArgumentsReaderMock = $this->getMock( + '\Magento\Framework\Code\Reader\SourceArgumentsReader', + [], + [], + '', + false + ); + $this->model = new \Magento\Framework\Code\Validator\ConstructorArgumentTypes( + $this->argumentsReaderMock, + $this->sourceArgumentsReaderMock + ); + } + + public function testValidate() + { + $className = '\stdClass'; + $classMock = new \ReflectionClass($className); + $this->argumentsReaderMock->expects($this->once())->method('getConstructorArguments')->with($classMock) + ->willReturn([['name' => 'Name1', 'type' => '\Type'], ['name' => 'Name2', 'type' => '\Type2']]); + $this->sourceArgumentsReaderMock->expects($this->once())->method('getConstructorArgumentTypes') + ->with($classMock)->willReturn(['\Type', '\Type2']); + $this->assertTrue($this->model->validate($className)); + } + + /** + * @expectedException \Magento\Framework\Code\ValidationException + * @expectedExceptionMessage Invalid constructor argument(s) in \stdClass + */ + public function testValidateWithException() + { + $className = '\stdClass'; + $classMock = new \ReflectionClass($className); + $this->argumentsReaderMock->expects($this->once())->method('getConstructorArguments')->with($classMock) + ->willReturn([['name' => 'Name1', 'type' => '\FAIL']]); + $this->sourceArgumentsReaderMock->expects($this->once())->method('getConstructorArgumentTypes') + ->with($classMock)->willReturn(['\Type', '\Fail']); + $this->assertTrue($this->model->validate($className)); + } +} + + diff --git a/dev/tests/unit/testsuite/Magento/Framework/Oauth/OauthInputExceptionTest.php b/dev/tests/unit/testsuite/Magento/Framework/Oauth/OauthInputExceptionTest.php new file mode 100644 index 0000000000000..6ed73ee0b7f97 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Framework/Oauth/OauthInputExceptionTest.php @@ -0,0 +1,29 @@ +addError(OauthInputException::REQUIRED_FIELD, ['fieldName' => $param]); + } + $exception->addError('Message with period.'); + + $this->assertEquals( + 'field1 is a required field, field2 is a required field, Message with period', + $exception->getAggregatedErrorMessage() + ); + } + + public function testGetAggregatedErrorMessageNoError() + { + $exception = new OauthInputException(); + $this->assertEquals('', $exception->getAggregatedErrorMessage()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Framework/Session/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Framework/Session/ConfigTest.php index 27b76cfd4b2df..7cf2c23ac1f70 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Session/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Session/ConfigTest.php @@ -364,7 +364,6 @@ public function constructorDataProvider() true, [ 'session.save_handler' => 'files', - 'session.save_path' => null, 'session.cache_limiter' => 'files', 'session.cookie_lifetime' => 7200, 'session.cookie_path' => '/', @@ -377,7 +376,6 @@ public function constructorDataProvider() false, [ 'session.save_handler' => 'files', - 'session.save_path' => null, 'session.cache_limiter' => 'files', 'session.cookie_httponly' => false, ], @@ -387,7 +385,6 @@ public function constructorDataProvider() true, [ 'session.save_handler' => 'files', - 'session.save_path' => null, 'session.cache_limiter' => 'files', 'session.cookie_lifetime' => 3600, 'session.cookie_path' => '/', diff --git a/dev/tests/unit/testsuite/Magento/Integration/Oauth/OauthTest.php b/dev/tests/unit/testsuite/Magento/Integration/Oauth/OauthTest.php index 67a17c1ddd5f5..82de98bfa27d4 100644 --- a/dev/tests/unit/testsuite/Magento/Integration/Oauth/OauthTest.php +++ b/dev/tests/unit/testsuite/Magento/Integration/Oauth/OauthTest.php @@ -28,9 +28,6 @@ class OauthTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\Oauth\Helper\Oauth */ private $_oauthHelperMock; - /** @var \Magento\Integration\Helper\Oauth\Data */ - private $_dataHelperMock; - /** @var \Magento\Framework\Oauth\Oauth */ private $_oauth; @@ -71,6 +68,7 @@ public function setUp() 'getCallbackUrl', 'save', 'getData', + 'isValidForTokenExchange', '__wakeup', ] ) @@ -109,9 +107,6 @@ public function setUp() $this->_oauthHelperMock = $this->getMockBuilder('Magento\Framework\Oauth\Helper\Oauth') ->setConstructorArgs([new \Magento\Framework\Math\Random()]) ->getMock(); - $this->_dataHelperMock = $this->getMockBuilder( - 'Magento\Integration\Helper\Oauth\Data' - )->disableOriginalConstructor()->getMock(); $this->_httpUtilityMock = $this->getMockBuilder('Zend_Oauth_Http_Utility') ->setMethods(['sign']) ->getMock(); @@ -130,8 +125,6 @@ public function setUp() $tokenProvider = new \Magento\Integration\Model\Oauth\Token\Provider( $this->_consumerFactory, $this->_tokenFactory, - $this->_dataHelperMock, - $this->_dateMock, $this->_loggerMock ); $this->_oauth = new \Magento\Framework\Oauth\Oauth( @@ -153,7 +146,6 @@ public function tearDown() unset($this->_nonceFactory); unset($this->_tokenFactory); unset($this->_oauthHelperMock); - unset($this->_dataHelperMock); unset($this->_httpUtilityMock); unset($this->_dateMock); unset($this->_oauth); @@ -227,14 +219,11 @@ public function testGetRequestTokenConsumerKeyNotFound() public function testGetRequestTokenOutdatedConsumerKey() { $this->_setupConsumer(); - $this->_dateMock->expects($this->any())->method('timestamp')->will($this->returnValue(9999999999)); - $this->_dataHelperMock->expects( - $this->once() - )->method( - 'getConsumerExpirationPeriod' - )->will( - $this->returnValue(0) - ); + $this->_setupNonce(); + $this->_consumerMock + ->expects($this->any()) + ->method('isValidForTokenExchange') + ->will($this->returnValue(false)); $this->_oauth->getRequestToken($this->_getRequestTokenParams(), self::REQUEST_URL); } @@ -276,14 +265,10 @@ protected function _setupConsumer($isLoadable = true) protected function _makeValidExpirationPeriod() { - $this->_dateMock->expects($this->any())->method('timestamp')->will($this->returnValue(0)); - $this->_dataHelperMock->expects( - $this->once() - )->method( - 'getConsumerExpirationPeriod' - )->will( - $this->returnValue(300) - ); + $this->_consumerMock + ->expects($this->any()) + ->method('isValidForTokenExchange') + ->will($this->returnValue(true)); } /** @@ -539,7 +524,7 @@ public function testGetAccessTokenParameterAbsent() /** * \Magento\Framework\Oauth\OauthInterface::ERR_TOKEN_REJECTED * - * @expectedException \Magento\Framework\Oauth\Exception + * @expectedException \Magento\Framework\Oauth\OauthInputException */ public function testGetAccessTokenTokenRejected() { diff --git a/lib/internal/Magento/Framework/Api/ExtensibleDataObjectConverter.php b/lib/internal/Magento/Framework/Api/ExtensibleDataObjectConverter.php index 64aaa76d07589..22cad52d286c5 100644 --- a/lib/internal/Magento/Framework/Api/ExtensibleDataObjectConverter.php +++ b/lib/internal/Magento/Framework/Api/ExtensibleDataObjectConverter.php @@ -32,11 +32,17 @@ public function __construct(DataObjectProcessor $dataObjectProcessor) * * @param ExtensibleDataInterface $dataObject * @param string[] $skipCustomAttributes + * @param string $dataObjectType * @return array */ - public function toNestedArray(ExtensibleDataInterface $dataObject, $skipCustomAttributes = []) - { - $dataObjectType = get_class($dataObject); + public function toNestedArray( + ExtensibleDataInterface $dataObject, + $skipCustomAttributes = [], + $dataObjectType = null + ) { + if ($dataObjectType == null) { + $dataObjectType = get_class($dataObject); + } $dataObjectArray = $this->dataObjectProcessor->buildOutputDataArray($dataObject, $dataObjectType); //process custom attributes if present if (!empty($dataObjectArray[AbstractExtensibleObject::CUSTOM_ATTRIBUTES_KEY])) { @@ -58,11 +64,15 @@ public function toNestedArray(ExtensibleDataInterface $dataObject, $skipCustomAt * * @param ExtensibleDataInterface $dataObject * @param string[] $skipCustomAttributes + * @param string $dataObjectType * @return array */ - public function toFlatArray(ExtensibleDataInterface $dataObject, $skipCustomAttributes = []) - { - $dataObjectArray = $this->toNestedArray($dataObject, $skipCustomAttributes); + public function toFlatArray( + ExtensibleDataInterface $dataObject, + $skipCustomAttributes = [], + $dataObjectType = null + ) { + $dataObjectArray = $this->toNestedArray($dataObject, $skipCustomAttributes, $dataObjectType); return ConvertArray::toFlatArray($dataObjectArray); } diff --git a/lib/internal/Magento/Framework/Api/SimpleDataObjectConverter.php b/lib/internal/Magento/Framework/Api/SimpleDataObjectConverter.php index 4dec0a5f2d322..47e40937f0c95 100644 --- a/lib/internal/Magento/Framework/Api/SimpleDataObjectConverter.php +++ b/lib/internal/Magento/Framework/Api/SimpleDataObjectConverter.php @@ -27,11 +27,14 @@ public function __construct(DataObjectProcessor $dataObjectProcessor) * Convert nested array into flat array. * * @param ExtensibleDataInterface $dataObject + * @param string $dataObjectType * @return array */ - public function toFlatArray(ExtensibleDataInterface $dataObject) + public function toFlatArray(ExtensibleDataInterface $dataObject, $dataObjectType = null) { - $dataObjectType = get_class($dataObject); + if ($dataObjectType === null) { + $dataObjectType = get_class($dataObject); + } $data = $this->dataObjectProcessor->buildOutputDataArray($dataObject, $dataObjectType); return ConvertArray::toFlatArray($data); } diff --git a/lib/internal/Magento/Framework/App/DeploymentConfig/BackendConfig.php b/lib/internal/Magento/Framework/App/DeploymentConfig/BackendConfig.php index e0cee2273c40d..20b3f461ceff2 100644 --- a/lib/internal/Magento/Framework/App/DeploymentConfig/BackendConfig.php +++ b/lib/internal/Magento/Framework/App/DeploymentConfig/BackendConfig.php @@ -26,7 +26,7 @@ class BackendConfig extends AbstractSegment */ public function __construct(array $data) { - if (!isset($data[self::KEY_FRONTNAME])) { + if (empty($data[self::KEY_FRONTNAME])) { throw new \InvalidArgumentException("No backend frontname provided."); } if (!preg_match('/^[a-zA-Z0-9_]+$/', $data[self::KEY_FRONTNAME])) { diff --git a/lib/internal/Magento/Framework/App/SetupInfo.php b/lib/internal/Magento/Framework/App/SetupInfo.php index 308608a6b9a31..06ce29f02930b 100644 --- a/lib/internal/Magento/Framework/App/SetupInfo.php +++ b/lib/internal/Magento/Framework/App/SetupInfo.php @@ -57,7 +57,7 @@ public function __construct($server, $projectRoot = '') if (empty($server['DOCUMENT_ROOT'])) { throw new \InvalidArgumentException('DOCUMENT_ROOT variable is unavailable.'); } - $this->docRoot = str_replace('\\', '/', $server['DOCUMENT_ROOT']); + $this->docRoot = rtrim(str_replace('\\', '/', $server['DOCUMENT_ROOT']), '/'); $this->projectRoot = $projectRoot ?: $this->detectProjectRoot(); $this->projectRoot = str_replace('\\', '/', $this->projectRoot); } diff --git a/lib/internal/Magento/Framework/Code/Reader/SourceArgumentsReader.php b/lib/internal/Magento/Framework/Code/Reader/SourceArgumentsReader.php new file mode 100644 index 0000000000000..c31fa9c00d8ab --- /dev/null +++ b/lib/internal/Magento/Framework/Code/Reader/SourceArgumentsReader.php @@ -0,0 +1,173 @@ +getFileName() || false == $class->hasMethod( + '__construct' + ) || !$inherited && $class->getConstructor()->class !== $class->getName() + ) { + return $output; + } + $reflectionConstructor = $class->getConstructor(); + $fileContent = file($class->getFileName()); + $availableNamespaces = $this->getImportedNamespaces($fileContent); + $availableNamespaces[0] = $class->getNamespaceName(); + $constructorStartLine = $reflectionConstructor->getStartLine() - 1; + $constructorEndLine = $reflectionConstructor->getEndLine(); + $fileContent = array_slice($fileContent, $constructorStartLine, $constructorEndLine - $constructorStartLine); + $source = ' $argument]; + } + unset($argument); + $arguments = array_filter($arguments, function ($token) { + $blacklist = [T_VARIABLE, T_WHITESPACE]; + if (isset($token[0]) && in_array($token[0], $blacklist)) { + return false; + } + return true; + }); + $arguments = array_map(function ($element) { + return $element[1]; + }, $arguments); + $arguments = array_values($arguments); + $arguments = implode('', $arguments); + if (empty($arguments)) { + return $output; + } + $arguments = explode(',', $arguments); + foreach ($arguments as $key => &$argument) { + $argument = $this->removeDefaultValue($argument); + $argument = $this->resolveNamespaces($argument, $availableNamespaces); + } + unset($argument); + return $arguments; + } + + /** + * Perform namespace resolution if required and return fully qualified name. + * + * @param string $argument + * @param array $availableNamespaces + * @return string + */ + protected function resolveNamespaces($argument, $availableNamespaces) + { + if (substr($argument, 0, 1) !== self::NS_SEPARATOR && $argument !== 'array' && !empty($argument)) { + $name = explode(self::NS_SEPARATOR, $argument); + $unqualifiedName = $name[0]; + $isQualifiedName = count($name) > 1 ? true : false; + if (isset($availableNamespaces[$unqualifiedName])) { + $namespace = $availableNamespaces[$unqualifiedName]; + if ($isQualifiedName) { + array_shift($name); + return $namespace . self::NS_SEPARATOR . implode(self::NS_SEPARATOR, $name); + } + return $namespace; + } else { + return self::NS_SEPARATOR . $availableNamespaces[0] . self::NS_SEPARATOR . $argument; + } + } + return $argument; + } + + /** + * Remove default value from argument. + * + * @param string $argument + * @return string + */ + protected function removeDefaultValue($argument) + { + $position = strpos($argument, '='); + if (is_numeric($position)) { + return substr($argument, 0, $position); + } + return $argument; + } + + /** + * Get all imported namespaces. + * + * @param array $file + * @return array + */ + protected function getImportedNamespaces(array $file) + { + $file = implode('', $file); + $file = token_get_all($file); + $classStart = array_search('{', $file); + $file = array_slice($file, 0, $classStart); + $output = []; + foreach ($file as $position => $token) { + if (is_array($token) && $token[0] === T_USE) { + $import = array_slice($file, $position); + $importEnd = array_search(';', $import); + $import = array_slice($import, 0, $importEnd); + $imports = []; + $importsCount = 0; + foreach ($import as $item) { + if ($item === ',') { + $importsCount++; + continue; + } + $imports[$importsCount][] = $item; + } + foreach ($imports as $import) { + $import = array_filter($import, function ($token) { + $whitelist = [T_NS_SEPARATOR, T_STRING, T_AS]; + if (isset($token[0]) && in_array($token[0], $whitelist)) { + return true; + } + return false; + }); + $import = array_map(function ($element) { + return $element[1]; + }, $import); + $import = array_values($import); + if ($import[0] === self::NS_SEPARATOR) { + array_shift($import); + } + $importName = null; + if (in_array('as', $import)) { + $importName = array_splice($import, -1)[0]; + array_pop($import); + } + $useStatement = implode('', $import); + if ($importName) { + $output[$importName] = self::NS_SEPARATOR . $useStatement; + } else { + $key = explode(self::NS_SEPARATOR, $useStatement); + $key = end($key); + $output[$key] = self::NS_SEPARATOR . $useStatement; + } + } + } + } + return $output; + } +} diff --git a/lib/internal/Magento/Framework/Code/Validator/ConstructorArgumentTypes.php b/lib/internal/Magento/Framework/Code/Validator/ConstructorArgumentTypes.php new file mode 100644 index 0000000000000..6fdfe35b430e5 --- /dev/null +++ b/lib/internal/Magento/Framework/Code/Validator/ConstructorArgumentTypes.php @@ -0,0 +1,58 @@ +argumentsReader = $argumentsReader ?: new \Magento\Framework\Code\Reader\ArgumentsReader(); + $this->sourceArgumentsReader = + $sourceArgumentsReader ?: new \Magento\Framework\Code\Reader\SourceArgumentsReader(); + } + + /** + * Validate class constructor arguments + * + * @param string $className + * @return bool + * @throws \Magento\Framework\Code\ValidationException + */ + public function validate($className) + { + $class = new \ReflectionClass($className); + $expectedArguments = $this->argumentsReader->getConstructorArguments($class); + $actualArguments = $this->sourceArgumentsReader->getConstructorArgumentTypes($class); + $expectedArguments = array_map(function ($element) { + return $element['type']; + }, $expectedArguments); + $result = array_diff($expectedArguments, $actualArguments); + if (!empty($result)) { + throw new \Magento\Framework\Code\ValidationException( + 'Invalid constructor argument(s) in ' . $className + ); + } + return true; + } +} diff --git a/lib/internal/Magento/Framework/Config/Composer/Package.php b/lib/internal/Magento/Framework/Config/Composer/Package.php index 7fe452a54cb59..ce9742f2c384f 100644 --- a/lib/internal/Magento/Framework/Config/Composer/Package.php +++ b/lib/internal/Magento/Framework/Config/Composer/Package.php @@ -23,7 +23,7 @@ class Package * * @param \StdClass $json */ - public function __construct(\StdClass $json) + public function __construct(\stdClass $json) { $this->json = $json; } diff --git a/lib/internal/Magento/Framework/Oauth/ConsumerInterface.php b/lib/internal/Magento/Framework/Oauth/ConsumerInterface.php index 9b9dda33c75a2..a6bab9c9dff4a 100644 --- a/lib/internal/Magento/Framework/Oauth/ConsumerInterface.php +++ b/lib/internal/Magento/Framework/Oauth/ConsumerInterface.php @@ -55,4 +55,11 @@ public function getCallbackUrl(); * @return string */ public function getCreatedAt(); + + /** + * Check if the consumer key has not expired for Oauth token exchange usage + * + * @return bool + */ + public function isValidForTokenExchange(); } diff --git a/lib/internal/Magento/Framework/Oauth/Helper/Request.php b/lib/internal/Magento/Framework/Oauth/Helper/Request.php index 84051adfc4e48..cf7dc348230bc 100644 --- a/lib/internal/Magento/Framework/Oauth/Helper/Request.php +++ b/lib/internal/Magento/Framework/Oauth/Helper/Request.php @@ -197,6 +197,9 @@ public function prepareErrorResponse(\Exception $exception, \Zend_Controller_Res $responseCode = self::HTTP_UNAUTHORIZED; } elseif ($exception instanceof \Magento\Framework\Oauth\OauthInputException) { $responseCode = self::HTTP_BAD_REQUEST; + if ($errorMsg == \Magento\Framework\Oauth\OauthInputException::DEFAULT_MESSAGE) { + $errorMsg = $exception->getAggregatedErrorMessage(); + } } else { $errorMsg = 'internal_error&message=' . ($errorMsg ? $errorMsg : 'empty_message'); $responseCode = self::HTTP_INTERNAL_ERROR; diff --git a/lib/internal/Magento/Framework/Oauth/Oauth.php b/lib/internal/Magento/Framework/Oauth/Oauth.php index dbdae85be1fde..88c2392922221 100644 --- a/lib/internal/Magento/Framework/Oauth/Oauth.php +++ b/lib/internal/Magento/Framework/Oauth/Oauth.php @@ -61,11 +61,9 @@ public static function getSupportedSignatureMethods() */ public function getRequestToken($params, $requestUrl, $httpMethod = 'POST') { - $this->_validateVersionParam($params['oauth_version']); + $this->_validateProtocolParams($params); $consumer = $this->_tokenProvider->getConsumerByKey($params['oauth_consumer_key']); $this->_tokenProvider->validateConsumer($consumer); - $this->_nonceGenerator->validateNonce($consumer, $params['oauth_nonce'], $params['oauth_timestamp']); - $this->_validateSignature($params, $consumer->getSecret(), $httpMethod, $requestUrl); return $this->_tokenProvider->createRequestToken($consumer); @@ -220,9 +218,9 @@ protected function _validateVersionParam($version) * @param array $protocolParams * @param array $requiredParams * @return void - * @throws Exception|OauthInputException + * @throws OauthInputException */ - protected function _validateProtocolParams($protocolParams, $requiredParams) + protected function _validateProtocolParams($protocolParams, $requiredParams = []) { // validate version if specified. if (isset($protocolParams['oauth_version'])) { @@ -247,7 +245,7 @@ protected function _validateProtocolParams($protocolParams, $requiredParams) $protocolParams['oauth_token'] ) ) { - throw new Exception('Token is not the correct length'); + throw new OauthInputException('Token is not the correct length'); } // Validate signature method. @@ -276,10 +274,14 @@ protected function _validateProtocolParams($protocolParams, $requiredParams) */ protected function _checkRequiredParams($protocolParams, $requiredParams) { + $exception = new OauthInputException(); foreach ($requiredParams as $param) { if (!isset($protocolParams[$param])) { - throw new OauthInputException(OauthInputException::REQUIRED_FIELD, ['fieldName' => $param]); + $exception->addError(OauthInputException::REQUIRED_FIELD, ['fieldName' => $param]); } } + if ($exception->wasErrorAdded()) { + throw $exception; + } } } diff --git a/lib/internal/Magento/Framework/Oauth/OauthInputException.php b/lib/internal/Magento/Framework/Oauth/OauthInputException.php index e568bab6c69e2..48410e27c8b6f 100644 --- a/lib/internal/Magento/Framework/Oauth/OauthInputException.php +++ b/lib/internal/Magento/Framework/Oauth/OauthInputException.php @@ -13,4 +13,22 @@ */ class OauthInputException extends InputException { + /** + * Get error messages as a single comma separated string + * + * @return string + */ + public function getAggregatedErrorMessage() + { + $errors = []; + foreach ($this->getErrors() as $error) { + // Clean up any trailing period + $errors[] = rtrim($error->getMessage(), '.'); + } + $errorMsg = ''; + if (!empty($errors)) { + $errorMsg = implode(', ', $errors); + } + return $errorMsg; + } } diff --git a/lib/internal/Magento/Framework/Session/Config.php b/lib/internal/Magento/Framework/Session/Config.php index a2485c75459bd..8ded4ded7584f 100644 --- a/lib/internal/Magento/Framework/Session/Config.php +++ b/lib/internal/Magento/Framework/Session/Config.php @@ -136,13 +136,14 @@ public function __construct( $this->setSaveHandler($saveMethod === 'db' ? 'user' : $saveMethod); - if (!$savePath) { + if (!$savePath && !ini_get('session.save_path')) { $sessionDir = $filesystem->getDirectoryWrite(DirectoryList::SESSION); $savePath = $sessionDir->getAbsolutePath(); $sessionDir->create(); } - $this->setSavePath($savePath); - + if ($savePath) { + $this->setSavePath($savePath); + } if ($cacheLimiter) { $this->setOption('session.cache_limiter', $cacheLimiter); } diff --git a/lib/internal/Magento/Framework/composer.json b/lib/internal/Magento/Framework/composer.json index 5c9e7d0b86e1e..d8dde599d2fa1 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.4.11|~5.5.0", + "php": "~5.4.11|~5.5.0|~5.6.0", "ext-spl": "*", "ext-dom": "*", "ext-simplexml": "*", diff --git a/setup/module/Magento/Setup/src/Controller/DatabaseCheck.php b/setup/module/Magento/Setup/src/Controller/DatabaseCheck.php index 99ab8fd4e58c4..0f5f911bd1626 100644 --- a/setup/module/Magento/Setup/src/Controller/DatabaseCheck.php +++ b/setup/module/Magento/Setup/src/Controller/DatabaseCheck.php @@ -20,14 +20,23 @@ class DatabaseCheck extends AbstractActionController */ private $installerFactory; + /** + * WebLogger to access log + * + * @var WebLogger + */ + private $webLogger; + /** * Constructor * * @param InstallerFactory $installerFactory + * @param WebLogger $webLogger */ - public function __construct(InstallerFactory $installerFactory) + public function __construct(InstallerFactory $installerFactory, WebLogger $webLogger) { $this->installerFactory = $installerFactory; + $this->webLogger = $webLogger; } /** @@ -39,7 +48,7 @@ public function indexAction() { $params = Json::decode($this->getRequest()->getContent(), Json::TYPE_ARRAY); try { - $installer = $this->installerFactory->create(new WebLogger()); + $installer = $this->installerFactory->create($this->webLogger); $password = isset($params['password']) ? $params['password'] : ''; $installer->checkDatabaseConnection($params['name'], $params['host'], $params['user'], $password); return new JsonModel(['success' => true]); diff --git a/setup/module/Magento/Setup/src/Model/WebLogger.php b/setup/module/Magento/Setup/src/Model/WebLogger.php index 5ffb080f9a5e1..eaf8db5f9a60a 100644 --- a/setup/module/Magento/Setup/src/Model/WebLogger.php +++ b/setup/module/Magento/Setup/src/Model/WebLogger.php @@ -6,6 +6,9 @@ namespace Magento\Setup\Model; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Filesystem; + /** * Web UI Logger * @@ -23,16 +26,16 @@ class WebLogger implements LoggerInterface /** * Currently open file resource * - * @var resource + * @var Filesystem */ - protected $resource; + protected $filesystem; /** - * Whether the log contains an error message + * Currently open file resource * - * @var bool + * @var \Magento\Framework\Filesystem\Directory\WriteInterface */ - protected $hasError = false; + protected $directory; /** * Indicator of whether inline output is started @@ -43,31 +46,15 @@ class WebLogger implements LoggerInterface /** * Constructor + * @param Filesystem $filesystem + * @param string $logFile */ - public function __construct() + public function __construct(Filesystem $filesystem, $logFile = null) { - $this->logFile = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $this->logFile; - } - - /** - * Opens log file in the specified mode - * - * @param string $mode - * @return void - */ - private function open($mode) - { - $this->resource = fopen($this->logFile, $mode); - } - - /** - * Closes the log file - * - * @return void - */ - private function close() - { - fclose($this->resource); + $this->directory = $filesystem->getDirectoryWrite(DirectoryList::LOG); + if ($logFile) { + $this->logFile = $logFile; + } } /** @@ -123,19 +110,7 @@ public function logMeta($message) */ private function writeToFile($message) { - $this->open('a+'); - fwrite($this->resource, $message); - $this->close(); - } - - /** - * Whether there is an error in the log - * - * @return bool - */ - public function hasError() - { - return $this->hasError; + $this->directory->writeFile($this->logFile, $message, 'a+'); } /** @@ -145,17 +120,8 @@ public function hasError() */ public function get() { - $this->open('r+'); - fseek($this->resource, 0); - $messages = []; - while (($string = fgets($this->resource)) !== false) { - if (strpos($string, '[ERROR]') !== false) { - $this->hasError = true; - } - $messages[] = $string; - } - $this->close(); - return $messages; + $fileContents = explode('\n', $this->directory->readFile($this->logFile)); + return $fileContents; } /** @@ -165,8 +131,8 @@ public function get() */ public function clear() { - if (file_exists($this->logFile)) { - unlink($this->logFile); + if ($this->directory->isExist($this->logFile)) { + $this->directory->delete($this->logFile); } } diff --git a/setup/module/Magento/Setup/view/magento/setup/customize-your-store.phtml b/setup/module/Magento/Setup/view/magento/setup/customize-your-store.phtml index b60b449e1ed93..1da49ed908e4f 100644 --- a/setup/module/Magento/Setup/view/magento/setup/customize-your-store.phtml +++ b/setup/module/Magento/Setup/view/magento/setup/customize-your-store.phtml @@ -17,7 +17,8 @@

-

Using sample of "fake" data can be helpful, letting you automatically build your store with fictious products, tax, and payment settings. But it also creates a lot of extra data you need to remove later. Learn the pros and cons in out Guide to Using Sample Data.

+

+ Select “Use Sample Data" to create a sample store with sample products, customers, and payment settings. Our Guide to Using Sample Data can help you get started.

diff --git a/setup/pub/magento/setup/landing.js b/setup/pub/magento/setup/landing.js index 4a49398e72980..c6539b54de37e 100644 --- a/setup/pub/magento/setup/landing.js +++ b/setup/pub/magento/setup/landing.js @@ -10,6 +10,7 @@ angular.module('landing', ['ngStorage']) '$location', '$localStorage', function ($scope, $location, $localStorage) { + $localStorage.$reset(); $scope.selectLanguage = function () { $localStorage.lang = $scope.modelLanguage; window.location = 'index.php/' + $scope.modelLanguage + '/index'; diff --git a/setup/pub/magento/setup/main.js b/setup/pub/magento/setup/main.js index 177cb0ccd421a..054a8378905a1 100644 --- a/setup/pub/magento/setup/main.js +++ b/setup/pub/magento/setup/main.js @@ -5,8 +5,7 @@ 'use strict'; var main = angular.module('main', ['ngStorage']); -main.controller('navigationController', ['$scope', '$state', '$rootScope', 'navigationService', '$localStorage', function ($scope, $state, $rootScope, navigationService, $localStorage) { - $localStorage.$reset(); +main.controller('navigationController', ['$scope', '$state', '$rootScope', 'navigationService', function ($scope, $state, $rootScope, navigationService) { navigationService.load(); $rootScope.isMenuEnabled = true; $scope.itemStatus = function (order) {